new Mouse(game)
Phaser - Mouse constructor.
Parameters:
| Name | Type | Description |
|---|---|---|
game |
Phaser.Game | A reference to the currently running game. |
- Source:
Members
-
<static, constant> LEFT_BUTTON :number
-
Type:
- number
- Source:
-
<static, constant> MIDDLE_BUTTON :number
-
Type:
- number
- Source:
-
<static, constant> NO_BUTTON :number
-
Type:
- number
- Source:
-
<static, constant> RIGHT_BUTTON :number
-
Type:
- number
- Source:
-
button
-
- Source:
Properties:
Name Type Description button-number The type of click, either: Phaser.Mouse.NO_BUTTON, Phaser.Mouse.LEFT_BUTTON, Phaser.Mouse.MIDDLE_BUTTON or Phaser.Mouse.RIGHT_BUTTON.
-
callbackContext
-
- Source:
Properties:
Name Type Description callbackContextObject Description.
-
disabled
-
You can disable all Input by setting disabled = true. While set all new input related events will be ignored.
- Default Value:
- false
- Source:
Properties:
Name Type Description disabledboolean -
game
-
- Source:
Properties:
Name Type Description gamePhaser.Game Local reference to game.
-
locked
-
If the mouse has been Pointer Locked successfully this will be set to true.
- Default Value:
- false
- Source:
Properties:
Name Type Description lockedboolean -
mouseDownCallback
-
- Default Value:
- null
- Source:
Properties:
Name Type Description mouseDownCallbackfunction Description.
-
mouseMoveCallback
-
- Default Value:
- null
- Source:
Properties:
Name Type Description mouseMoveCallbackfunction Description.
-
mouseUpCallback
-
- Default Value:
- null
- Source:
Properties:
Name Type Description mouseUpCallbackfunction Description.
-
pointerLock
-
This event is dispatched when the browser enters or leaves pointer lock state.
- Source:
Properties:
Name Type Description pointerLockPhaser.Signal
Methods
-
onMouseDown(event)
-
The internal method that handles the mouse down event from the browser.
Parameters:
Name Type Description eventMouseEvent - Source:
-
onMouseMove(event)
-
The internal method that handles the mouse move event from the browser.
Parameters:
Name Type Description eventMouseEvent - Source:
-
onMouseUp(event)
-
The internal method that handles the mouse up event from the browser.
Parameters:
Name Type Description eventMouseEvent - Source:
-
pointerLockChange(event)
-
Internal pointerLockChange handler.
Parameters:
Name Type Description eventMouseEvent - Source:
-
releasePointerLock()
-
Internal release pointer lock handler.
- Source:
-
requestPointerLock()
-
If the browser supports it you can request that the pointer be locked to the browser window. This is classically known as 'FPS controls', where the pointer can't leave the browser until the user presses an exit key. If the browser successfully enters a locked state the event Phaser.Mouse.pointerLock will be dispatched and the first parameter will be 'true'.
- Source:
-
start()
-
Starts the event listeners running.
- Source:
-
stop()
-
Stop the event listeners.
- Source: