Angel 3.2
A 2D Game Prototyping Engine
Public Member Functions | List of all members
MouseListener Class Reference

An abstract interface for getting mouse events. More...

#include <MouseInput.h>

+ Inheritance diagram for MouseListener:

Public Member Functions

 MouseListener ()
 
virtual ~MouseListener ()
 
virtual void MouseMotionEvent (Vec2i screenCoordinates)
 
virtual void MouseDownEvent (Vec2i screenCoordinates, MouseButtonInput button)
 
virtual void MouseUpEvent (Vec2i screenCoordinates, MouseButtonInput button)
 
virtual void MouseWheelEvent (const Vector2 &scrollOffset)
 

Detailed Description

This is an abstract base class which provides an interface to get notifications about what's going on with the mouse. If you want to get mouse data, derive a class from this one and implement the Mouse*Event member functions.

Definition at line 49 of file MouseInput.h.

Constructor & Destructor Documentation

MouseListener::MouseListener ( )

Base constructor adds this object to the list of objects to get notified when mousey things happen.

Definition at line 38 of file MouseInput.cpp.

MouseListener::~MouseListener ( )
virtual

Base destructor removes this object from the list.

Definition at line 43 of file MouseInput.cpp.

Member Function Documentation

void MouseListener::MouseMotionEvent ( Vec2i  screenCoordinates)
virtual

Called whenever the player moves the mouse.

Parameters
screenCoordinatesThe new coordinates of the mouse in screen coordinates (pixels). Use the MathUtil::ScreenToWorld function if you want GL units.

Reimplemented in UserInterface, and MobileSimulator.

Definition at line 51 of file MouseInput.cpp.

void MouseListener::MouseDownEvent ( Vec2i  screenCoordinates,
MouseButtonInput  button 
)
virtual

Called whenever the player presses down on a mouse button.

Parameters
screenCoordinatesThe new coordinates of the mouse in screen coordinates (pixels). Use the MathUtil::ScreenToWorld function if you want GL units.
buttonWhich button was pressed. Will be one of MOUSE_LEFT, MOUSE_MIDDLE, or MOUSE_RIGHT.

Reimplemented in UserInterface, and MobileSimulator.

Definition at line 49 of file MouseInput.cpp.

void MouseListener::MouseUpEvent ( Vec2i  screenCoordinates,
MouseButtonInput  button 
)
virtual

Called whenever the player releases a mouse button.

Parameters
screenCoordinatesThe new coordinates of the mouse in screen coordinates (pixels). Use the MathUtil::ScreenToWorld function if you want GL units.
buttonWhich button was released. Will be one of MOUSE_LEFT, MOUSE_MIDDLE, or MOUSE_RIGHT.

Reimplemented in UserInterface, and MobileSimulator.

Definition at line 50 of file MouseInput.cpp.

void MouseListener::MouseWheelEvent ( const Vector2 scrollOffset)
virtual

Called whenever the player moves the scroll wheel on the mouse.

Parameters
scrollOffsetThe change in position of the scroll wheel. Note that if it's an actual wheel, the X component of the vector will always be 0; the two-dimensional vector also takes into account trackpad scrolling.

Reimplemented in UserInterface.

Definition at line 52 of file MouseInput.cpp.


The documentation for this class was generated from the following files: