The mouse event. More...
Inherits Event.
Public Types | |
enum | MouseEventType |
MouseEventType Different types of MouseEvent. More... | |
Public Types inherited from Event | |
enum | Type |
Type Event type. | |
Public Member Functions | |
EventMouse (MouseEventType mouseEventCode) | |
Constructor. More... | |
void | setScrollData (float scrollX, float scrollY) |
Set mouse scroll data. More... | |
float | getScrollX () const |
Get mouse scroll data of x axis. More... | |
float | getScrollY () const |
Get mouse scroll data of y axis. More... | |
void | setCursorPosition (float x, float y) |
Set the cursor position. More... | |
void | setMouseButton (MouseButton button) |
Set mouse button. More... | |
MouseButton | getMouseButton () const |
Get mouse button. More... | |
float | getCursorX () const |
Get the cursor position of x axis. More... | |
float | getCursorY () const |
Get the cursor position of y axis. More... | |
Vec2 | getLocation () const |
Returns the current touch location in OpenGL coordinates. More... | |
Vec2 | getPreviousLocation () const |
Returns the previous touch location in OpenGL coordinates. More... | |
Vec2 | getStartLocation () const |
Returns the start touch location in OpenGL coordinates. More... | |
Vec2 | getDelta () const |
Returns the delta of 2 current touches locations in screen coordinates. More... | |
Vec2 | getLocationInView () const |
Returns the current touch location in screen coordinates. More... | |
Vec2 | getPreviousLocationInView () const |
Returns the previous touch location in screen coordinates. More... | |
Vec2 | getStartLocationInView () const |
Returns the start touch location in screen coordinates. More... | |
Public Member Functions inherited from Event | |
virtual | ~Event () |
Destructor. | |
Type | getType () const |
Gets the event type. More... | |
void | stopPropagation () |
Stops propagation for current event. | |
bool | isStopped () const |
Checks whether the event has been stopped. More... | |
Node * | getCurrentTarget () |
Gets current target of the event. More... | |
Public Member Functions inherited from Ref | |
void | retain () |
Retains the ownership. More... | |
void | release () |
Releases the ownership immediately. More... | |
Ref * | autorelease () |
Releases the ownership sometime soon automatically. More... | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. More... | |
virtual | ~Ref () |
Destructor. More... | |
Additional Inherited Members | |
Public Attributes inherited from Ref | |
unsigned int | _ID |
object id, ScriptSupport need public _ID | |
int | _luaID |
Lua reference id. | |
void * | _scriptObject |
scriptObject, support for swift | |
bool | _rooted |
When true, it means that the object was already rooted. | |
Protected Member Functions inherited from Event | |
Event (Type type) | |
Constructor. | |
The mouse event.
|
strong |
MouseEventType Different types of MouseEvent.
@js NA
EventMouse | ( | MouseEventType | mouseEventCode | ) |
Constructor.
mouseEventCode | A given mouse event type. @js ctor |
|
inline |
Set mouse scroll data.
scrollX | The scroll data of x axis. |
scrollY | The scroll data of y axis. |
|
inline |
Get mouse scroll data of x axis.
|
inline |
Get mouse scroll data of y axis.
|
inline |
Set the cursor position.
x | The x coordinate of cursor position. |
y | The y coordinate of cursor position. @js setLocation |
|
inline |
Set mouse button.
button | a given mouse button. @js setButton |
|
inline |
Get mouse button.
|
inline |
Get the cursor position of x axis.
|
inline |
Get the cursor position of y axis.
Vec2 getLocation | ( | ) | const |
Returns the current touch location in OpenGL coordinates.
Vec2 getPreviousLocation | ( | ) | const |
Returns the previous touch location in OpenGL coordinates.
Vec2 getStartLocation | ( | ) | const |
Returns the start touch location in OpenGL coordinates.
Vec2 getDelta | ( | ) | const |
Returns the delta of 2 current touches locations in screen coordinates.
Vec2 getLocationInView | ( | ) | const |
Returns the current touch location in screen coordinates.
Vec2 getPreviousLocationInView | ( | ) | const |
Returns the previous touch location in screen coordinates.
Vec2 getStartLocationInView | ( | ) | const |
Returns the start touch location in screen coordinates.