new Pointer(game, id)
Phaser - Pointer constructor.
Parameters:
Name | Type | Description |
---|---|---|
game |
Phaser.Game | A reference to the currently running game. |
id |
Description | Description. |
- Source:
Members
-
active
-
Description.
- Default Value:
- false
- Source:
Properties:
Name Type Description isDown
boolean Description.
-
circle
-
A Circle object centered on the x/y screen coordinates of the Pointer. Default size of 44px (Apple's recommended "finger tip" size).
- Default Value:
- null
- Source:
Properties:
Name Type Description circle
Circle -
circle
-
Description
- Source:
Properties:
Name Type Description circle
Phaser.Circle -
clientX
-
The horizontal coordinate of point relative to the viewport in pixels, excluding any scroll offset.
- Source:
Properties:
Name Type Description clientX
number -
clientY
-
The vertical coordinate of point relative to the viewport in pixels, excluding any scroll offset.
- Source:
Properties:
Name Type Description clientY
number -
<readonly> duration
-
How long the Pointer has been depressed on the touchscreen. If not currently down it returns -1.
- Source:
Properties:
Name Type Description duration
number How long the Pointer has been depressed on the touchscreen. If not currently down it returns -1.
-
game
-
- Source:
Properties:
Name Type Description game
Phaser.Game Local reference to game.
-
id
-
- Source:
Properties:
Name Type Description id
Description Description.
-
isDown
-
If the Pointer is touching the touchscreen, or the mouse button is held down, isDown is set to true.
- Default Value:
- false
- Source:
Properties:
Name Type Description isDown
boolean -
isMouse :boolean
-
If the Pointer is a mouse this is true, otherwise false.
Type:
- boolean
- Source:
Properties:
Name Type Description isMouse
boolean -
isUp
-
If the Pointer is not touching the touchscreen, or the mouse button is up, isUp is set to true.
- Default Value:
- true
- Source:
Properties:
Name Type Description isUp
boolean -
msSinceLastClick
-
The number of miliseconds since the last click.
- Source:
Properties:
Name Type Description msSinceLastClick
number -
pageX
-
The horizontal coordinate of point relative to the viewport in pixels, including any scroll offset.
- Source:
Properties:
Name Type Description pageX
number -
pageY
-
The vertical coordinate of point relative to the viewport in pixels, including any scroll offset.
- Source:
Properties:
Name Type Description pageY
number -
position
-
A Vector object containing the current position of the Pointer on the screen.
- Default Value:
- null
- Source:
Properties:
Name Type Description position
Vec2 -
position
-
Description
- Source:
Properties:
Name Type Description position
Phaser.Point -
positionDown
-
A Vector object containing the initial position when the Pointer was engaged with the screen.
- Default Value:
- null
- Source:
Properties:
Name Type Description positionDown
Vec2 -
positionDown
-
Description
- Source:
Properties:
Name Type Description positionDown
Phaser.Point -
previousTapTime
-
A timestamp representing when the Pointer was last tapped or clicked.
- Default Value:
- 0
- Source:
Properties:
Name Type Description previousTapTime
number -
screenX
-
The horizontal coordinate of point relative to the screen in pixels.
- Source:
Properties:
Name Type Description screenX
number -
screenY
-
The vertical coordinate of point relative to the screen in pixels.
- Source:
Properties:
Name Type Description screenY
number -
targetObject
-
The Game Object this Pointer is currently over / touching / dragging.
- Default Value:
- null
- Source:
Properties:
Name Type Description targetObject
Any -
timeDown
-
A timestamp representing when the Pointer first touched the touchscreen.
- Default Value:
- 0
- Source:
Properties:
Name Type Description timeDown
number -
timeUp
-
A timestamp representing when the Pointer left the touchscreen.
- Default Value:
- 0
- Source:
Properties:
Name Type Description timeUp
number -
totalTouches
-
The total number of times this Pointer has been touched to the touchscreen.
- Default Value:
- 0
- Source:
Properties:
Name Type Description totalTouches
number -
withinGame
-
Description.
- Source:
Properties:
Name Type Description withinGame
boolean -
<readonly> worldX
-
Gets the X value of this Pointer in world coordinates based on the world camera.
- Source:
Properties:
Name Type Description duration
number The X value of this Pointer in world coordinates based on the world camera.
-
<readonly> worldY
-
Gets the Y value of this Pointer in world coordinates based on the world camera.
- Source:
Properties:
Name Type Description duration
number The Y value of this Pointer in world coordinates based on the world camera.
-
x
-
The horizontal coordinate of point relative to the game element. This value is automatically scaled based on game size.
- Source:
Properties:
Name Type Description x
number -
y
-
The vertical coordinate of point relative to the game element. This value is automatically scaled based on game size.
- Source:
Properties:
Name Type Description y
number
Methods
-
justPressed(duration) → {boolean}
-
The Pointer is considered justPressed if the time it was pressed onto the touchscreen or clicked is less than justPressedRate.
Parameters:
Name Type Argument Description duration
number <optional>
- Source:
Returns:
- Type
- boolean
-
justReleased(duration) → {boolean}
-
The Pointer is considered justReleased if the time it left the touchscreen is less than justReleasedRate.
Parameters:
Name Type Argument Description duration
number <optional>
- Source:
Returns:
- Type
- boolean
-
leave(event)
-
Called when the Pointer leaves the target area.
Parameters:
Name Type Description event
Any - Source:
-
move(event)
-
Called when the Pointer is moved
Parameters:
Name Type Description event
Any - Source:
-
reset()
-
Resets the Pointer properties. Called by InputManager.reset when you perform a State change.
- Source:
-
start(event)
-
Called when the Pointer is pressed onto the touchscreen.
Parameters:
Name Type Description event
Any - Source:
-
stop(event)
-
Called when the Pointer leaves the touchscreen.
Parameters:
Name Type Description event
Any - Source:
-
toString() → {string}
-
Returns a string representation of this object.
- Source:
Returns:
A string representation of the instance.
- Type
- string
-
update()
-
Description.
- Source: