A reference to the currently running game.
The ID of the Pointer object within the game. Each game can have up to 10 active pointers.
The operational mode of this pointer, eg. CURSOR or TOUCH.
An active pointer is one that is currently pressed down on the display.
An active pointer is one that is currently pressed down on the display. A Mouse is always active.
If this Pointer is a Mouse or Pen / Stylus then you can access its X1 (back) button directly through this property.
If this Pointer is a Mouse or Pen / Stylus then you can access its X1 (back) button directly through this property.
The DeviceButton has its own properties such as isDown
, duration and methods like justReleased for more fine-grained
button control.
Please see the DeviceButton docs for details on browser button limitations.
The button property of the most recent DOM event when this Pointer is started.
The button property of the most recent DOM event when this Pointer is started.
You should not rely on this value for accurate button detection, instead use the Pointer properties
leftButton
, rightButton
, middleButton
and so on.
A Phaser.Circle that is centered on the x/y coordinates of this pointer, useful for hit detection.
A Phaser.Circle that is centered on the x/y coordinates of this pointer, useful for hit detection. The Circle size is 44px (Apples recommended "finger tip" size).
The horizontal coordinate of the Pointer within the application's client area at which the event occurred (as opposed to the coordinates within the page).
The vertical coordinate of the Pointer within the application's client area at which the event occurred (as opposed to the coordinates within the page).
A dirty pointer needs to re-poll any interactive objects it may have been over, regardless if it has moved or not
How long the Pointer has been depressed on the touchscreen or any of the mouse buttons have been held down.
How long the Pointer has been depressed on the touchscreen or any of the mouse buttons have been held down. If not currently down it returns -1. If you need to test a specific mouse or pen button then access the buttons directly, i.e. Pointer.rightButton.duration.
If this Pointer is a Pen / Stylus then you can access its eraser button directly through this property.
If this Pointer is a Pen / Stylus then you can access its eraser button directly through this property.
The DeviceButton has its own properties such as isDown, duration and methods like justReleased for more fine-grained button control.
Please see the DeviceButton docs for details on browser button limitations.
A Pointer object that exists is allowed to be checked for physics collisions and overlaps.
If this Pointer is a Mouse or Pen / Stylus then you can access its X2 (forward) button directly through this property.
If this Pointer is a Mouse or Pen / Stylus then you can access its X2 (forward) button directly through this property.
The DeviceButton has its own properties such as isDown, duration and methods like justReleased for more fine-grained button control.
Please see the DeviceButton docs for details on browser button limitations.
This array is erased and re-populated every time this Pointer is updated.
This array is erased and re-populated every time this Pointer is updated. It contains references to all of the Game Objects that were considered as being valid for processing by this Pointer, this frame. To be valid they must have suitable a priorityID, be Input enabled, visible and actually have the Pointer over them. You can check the contents of this array in events such as onInputDown, but beware it is reset every frame.
If the Pointer is touching the touchscreen, or any mouse or pen button is held down, isDown is set to true.
If the Pointer is touching the touchscreen, or any mouse or pen button is held down, isDown is set to true. If you need to check a specific mouse or pen button then use the button properties, i.e. Pointer.rightButton.isDown.
If the Pointer is a mouse or pen / stylus this is true, otherwise false.
If the Pointer is not touching the touchscreen, or all mouse or pen buttons are up, isUp is set to true.
If the Pointer is not touching the touchscreen, or all mouse or pen buttons are up, isUp is set to true. If you need to check a specific mouse or pen button then use the button properties, i.e. Pointer.rightButton.isUp.
The Pointer is considered justPressed
if the time it was pressed onto the touchscreen or clicked is less than justPressedRate
.
The Pointer is considered justPressed
if the time it was pressed onto the touchscreen or clicked is less than justPressedRate
.
Note that calling justPressed
doesn't reset the pressed status of the Pointer, it will return true for as long as
the duration is valid.
If you wish to check if the Pointer was pressed down just once then see the Sprite.events.onInputDown
event.
The time to check against. If none given it will use InputManager.justPressedRate.
true if the Pointer was pressed down within the duration given.
The Pointer is considered justReleased
if the time it left the touchscreen is less than justReleasedRate
.
The Pointer is considered justReleased
if the time it left the touchscreen is less than justReleasedRate
.
Note that calling justReleased
doesn't reset the pressed status of the Pointer, it will return true for as
long as the duration is valid.
If you wish to check if the Pointer was released just once then see the Sprite.events.onInputUp
event.
The time to check against. If none given it will use InputManager.justReleasedRate.
true if the Pointer was released within the duration given.
Called when the Pointer leaves the target area.
Called when the Pointer leaves the target area.
The event passed up from the input handler (MouseEvent | PointerEvent | TouchEvent).
If this Pointer is a Mouse or Pen / Stylus then you can access its left button directly through this property.
If this Pointer is a Mouse or Pen / Stylus then you can access its left button directly through this property.
The DeviceButton has its own properties such as isDown
, duration and methods like justReleased
for more fine-grained
button control.
If this Pointer is a Mouse or Pen / Stylus then you can access its middle button directly through this property.
If this Pointer is a Mouse or Pen / Stylus then you can access its middle button directly through this property.
The DeviceButton has its own properties such as isDown, duration and methods like justReleased for more fine-grained button control.
Please see the DeviceButton docs for details on browser button limitations.
Called when the Pointer is moved.
Called when the Pointer is moved.
The event passed up from the input handler (MouseEvent | PointerEvent | TouchEvent).
Was this called from the click event?
The horizontal processed relative movement of the Pointer in pixels since last event.
The vertical processed relative movement of the Pointer in pixels since last event.
The number of milliseconds since the last click or touch event.
The horizontal coordinate of the Pointer relative to whole document.
The vertical coordinate of the Pointer relative to whole document.
The pointerId property of the Pointer as set by the DOM event when this Pointer is started.
The pointerId property of the Pointer as set by the DOM event when this Pointer is started. The browser can and will recycle this value.
A Phaser.Point object containing the current x/y values of the pointer on the display.
A Phaser.Point object containing the x/y values of the pointer when it was last in a down state on the display.
A Phaser.Point object containing the x/y values of the pointer when it was last released.
A timestamp representing when the Pointer was last tapped or clicked.
The horizontal raw relative movement of the Pointer in pixels since last event.
The vertical raw relative movement of the Pointer in pixels since last event.
Resets the Pointer properties.
Resets the Pointer properties. Called by InputManager.reset when you perform a State change.
Resets the movementX and movementY properties.
Resets the movementX and movementY properties. Use in your update handler after retrieving the values.
If this Pointer is a Mouse or Pen / Stylus then you can access its right button directly through this property.
If this Pointer is a Mouse or Pen / Stylus then you can access its right button directly through this property.
The DeviceButton has its own properties such as isDown
, duration and methods like justReleased
for more fine-grained
button control.
Please see the DeviceButton docs for details on browser button limitations.
The horizontal coordinate of the Pointer relative to the screen.
The vertical coordinate of the Pointer relative to the screen.
Called when the Pointer is pressed onto the touchscreen.
Called when the Pointer is pressed onto the touchscreen.
The DOM event from the browser.
Called when the Pointer leaves the touchscreen.
Called when the Pointer leaves the touchscreen.
The event passed up from the input handler (MouseEvent | PointerEvent | TouchEvent).
This will change the Pointer.targetObject
object to be the one provided.
This will change the Pointer.targetObject
object to be the one provided.
This allows you to have fine-grained control over which object the Pointer is targeting.
Note that even if you set a new Target here, it is still able to be replaced by any other valid
target during the next Pointer update.
The new target for this Pointer. Note this is an InputHandler, so don't pass a Sprite,
instead pass sprite.input
to it.
If true the new target AND the old one will NOT dispatch their onInputOver
or onInputOut
events.
The target property of the Pointer as set by the DOM event when this Pointer is started.
The Game Object this Pointer is currently over / touching / dragging.
A timestamp representing when the Pointer first touched the touchscreen.
A timestamp representing when the Pointer left the touchscreen.
The total number of times this Pointer has been touched to the touchscreen.
The const type of this object.
Called by the Input Manager.
Returns true if the Pointer is over the game canvas, otherwise false.
Gets the X value of this Pointer in world coordinates based on the world camera.
Gets the Y value of this Pointer in world coordinates based on the world camera.
The horizontal coordinate of the Pointer.
The horizontal coordinate of the Pointer. This value is automatically scaled based on the game scale.
The vertical coordinate of the Pointer.
The vertical coordinate of the Pointer. This value is automatically scaled based on the game scale.
A Pointer object is used by the Mouse, Touch and MSPoint managers and represents a single finger on the touch screen.
http://phaser.io/docs/2.6.2/Phaser.Pointer.html