zerk.game.engine.system.control.mouse Class
Mouse Interface
Provides methods to handle mouse inputs.
Item Index
Methods
Properties
Methods
_getCursorPosition
-
event
Returns the position of the cursor by given mouse event
Parameters:
-
event
EventNative mouse event
Returns:
_onContextMenu
-
event
Context menu event handler
Parameters:
-
event
EventNative event
Returns:
_onMouseDown
-
event
Mouse down event handler
Parameters:
-
event
EventNative event
Returns:
_onMouseMove
-
event
Mouse move event handler
Parameters:
-
event
EventNative event
_onMouseScroll
-
event
Mouse scroll event handler
Parameters:
-
event
EventNative event
_onMouseUp
-
event
Mouse up event handler
Parameters:
-
event
EventNative event
Returns:
fireEvent
-
event
Fire event
Parameters:
-
event
StringEvent name
Returns:
on
-
event
-
callback
-
scope
Register event handler
Parameters:
-
event
StringEvent name
-
callback
FunctionCallback function. Return false to cancel event bubble.
-
scope
ObjectScope to be used in callback function
un
-
event
-
callback
Unregister event handler
Parameters:
-
event
StringEvent name
-
callback
FunctionCallback function
Returns:
Properties
_eventListeners
Array
protected
List of event handlers
_lastMousePosition
Object
protected
Coordinates of the last mouse position
_mouseJointActive
Boolean
protected
State of the mouse joint
mouseLeftDown
Boolean
State of the left mouse button
mouseRightDown
Boolean
State of the right mouse button
mouseX
Integer
Horizontal cursor position
mouseX
Integer
Vertical cursor position
Events
mousedown
Fires when a mouse button is pressed
Event Payload:
-
event
DOMEvent
mouseup
Fires when a mouse button is released
Event Payload:
-
event
DOMEvent