Class cc.EventMouse
- Defined in: CCEvent.js
- Extends cc.Event
Constructor Attributes | Constructor Name and Description |
---|---|
The mouse event
|
Method Summary
Class Detail
cc.EventMouse()
The mouse event
Field Detail
<static> <constant>
cc.EventMouse.BUTTON_4
The tag of Mouse button 4
<static> <constant>
cc.EventMouse.BUTTON_5
The tag of Mouse button 5
<static> <constant>
cc.EventMouse.BUTTON_6
The tag of Mouse button 6
<static> <constant>
cc.EventMouse.BUTTON_7
The tag of Mouse button 7
<static> <constant>
cc.EventMouse.BUTTON_8
The tag of Mouse button 8
<static> <constant>
cc.EventMouse.BUTTON_LEFT
The tag of Mouse left button
<static> <constant>
cc.EventMouse.BUTTON_MIDDLE
The tag of Mouse middle button (The right button number is 1 on browser)
<static> <constant>
cc.EventMouse.BUTTON_RIGHT
The tag of Mouse right button (The right button number is 2 on browser)
<static> <constant>
cc.EventMouse.DOWN
The event type code of mouse down event.
<static> <constant>
cc.EventMouse.MOVE
The event type code of mouse move event.
<static> <constant>
cc.EventMouse.NONE
The none event code of mouse event.
<static> <constant>
cc.EventMouse.SCROLL
The event type code of mouse scroll event.
<static> <constant>
cc.EventMouse.UP
The event type code of mouse up event.
Method Detail
-
{number} getButton()Returns mouse button
- Returns:
- {number}
-
{cc.Point} getDelta()Returns the delta distance from the previous location to current location
- Returns:
- {cc.Point}
-
{Number} getDeltaX()Returns the X axis delta distance from the previous location to current location
- Returns:
- {Number}
-
{Number} getDeltaY()Returns the Y axis delta distance from the previous location to current location
- Returns:
- {Number}
-
{cc.Point} getLocation()Returns cursor location
- Returns:
- {cc.Point} location
-
{cc.Point} getLocationInView()Returns the current cursor location in screen coordinates
- Returns:
- {cc.Point}
-
{number} getLocationX()Returns location X axis data
- Returns:
- {number}
-
{number} getLocationY()Returns location Y axis data
- Returns:
- {number}
-
{number} getScrollX()Returns the x axis scroll value
- Returns:
- {number}
-
{number} getScrollY()Returns the y axis scroll value
- Returns:
- {number}
-
setButton(button)Sets mouse button
- Parameters:
- {number} button
-
setLocation(x, y)Sets cursor location
- Parameters:
- {number} x
- {number} y
-
setScrollData(scrollX, scrollY)Sets scroll data
- Parameters:
- {number} scrollX
- {number} scrollY