Class: Mouse

Phaser. Mouse

The Mouse class

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

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.

Source:

callbackContext

Properties:
Name Type Description
callbackContext Object

Description.

Source:

disabled

You can disable all Input by setting disabled = true. While set all new input related events will be ignored.

Properties:
Name Type Description
disabled boolean
Default Value:
  • false
Source:

game

Properties:
Name Type Description
game Phaser.Game

Local reference to game.

Source:

locked

If the mouse has been Pointer Locked successfully this will be set to true.

Properties:
Name Type Description
locked boolean
Default Value:
  • false
Source:

mouseDownCallback

Properties:
Name Type Description
mouseDownCallback function

Description.

Default Value:
  • null
Source:

mouseMoveCallback

Properties:
Name Type Description
mouseMoveCallback function

Description.

Default Value:
  • null
Source:

mouseUpCallback

Properties:
Name Type Description
mouseUpCallback function

Description.

Default Value:
  • null
Source:

pointerLock

This event is dispatched when the browser enters or leaves pointer lock state.

Properties:
Name Type Description
pointerLock Phaser.Signal
Source:

Methods

onMouseDown(event)

The internal method that handles the mouse down event from the browser.

Parameters:
Name Type Description
event MouseEvent
Source:

onMouseMove(event)

The internal method that handles the mouse move event from the browser.

Parameters:
Name Type Description
event MouseEvent
Source:

onMouseUp(event)

The internal method that handles the mouse up event from the browser.

Parameters:
Name Type Description
event MouseEvent
Source:

pointerLockChange(event)

Internal pointerLockChange handler.

Parameters:
Name Type Description
event MouseEvent
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:
Phaser Copyright © 2012-2013 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Thu Nov 07 2013 06:07:38 GMT-0000 (GMT) using the DocStrap template.