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 isDownboolean 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 circleCircle -
circle
-
Description
- Source:
Properties:
Name Type Description circlePhaser.Circle -
clientX
-
The horizontal coordinate of point relative to the viewport in pixels, excluding any scroll offset.
- Source:
Properties:
Name Type Description clientXnumber -
clientY
-
The vertical coordinate of point relative to the viewport in pixels, excluding any scroll offset.
- Source:
Properties:
Name Type Description clientYnumber -
<readonly> duration
-
How long the Pointer has been depressed on the touchscreen. If not currently down it returns -1.
- Source:
Properties:
Name Type Description durationnumber How long the Pointer has been depressed on the touchscreen. If not currently down it returns -1.
-
game
-
- Source:
Properties:
Name Type Description gamePhaser.Game Local reference to game.
-
id
-
- Source:
Properties:
Name Type Description idDescription 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 isDownboolean -
isMouse :boolean
-
If the Pointer is a mouse this is true, otherwise false.
Type:
- boolean
- Source:
Properties:
Name Type Description isMouseboolean -
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 isUpboolean -
msSinceLastClick
-
The number of miliseconds since the last click.
- Source:
Properties:
Name Type Description msSinceLastClicknumber -
pageX
-
The horizontal coordinate of point relative to the viewport in pixels, including any scroll offset.
- Source:
Properties:
Name Type Description pageXnumber -
pageY
-
The vertical coordinate of point relative to the viewport in pixels, including any scroll offset.
- Source:
Properties:
Name Type Description pageYnumber -
position
-
A Vector object containing the current position of the Pointer on the screen.
- Default Value:
- null
- Source:
Properties:
Name Type Description positionVec2 -
position
-
Description
- Source:
Properties:
Name Type Description positionPhaser.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 positionDownVec2 -
positionDown
-
Description
- Source:
Properties:
Name Type Description positionDownPhaser.Point -
previousTapTime
-
A timestamp representing when the Pointer was last tapped or clicked.
- Default Value:
- 0
- Source:
Properties:
Name Type Description previousTapTimenumber -
screenX
-
The horizontal coordinate of point relative to the screen in pixels.
- Source:
Properties:
Name Type Description screenXnumber -
screenY
-
The vertical coordinate of point relative to the screen in pixels.
- Source:
Properties:
Name Type Description screenYnumber -
targetObject
-
The Game Object this Pointer is currently over / touching / dragging.
- Default Value:
- null
- Source:
Properties:
Name Type Description targetObjectAny -
timeDown
-
A timestamp representing when the Pointer first touched the touchscreen.
- Default Value:
- 0
- Source:
Properties:
Name Type Description timeDownnumber -
timeUp
-
A timestamp representing when the Pointer left the touchscreen.
- Default Value:
- 0
- Source:
Properties:
Name Type Description timeUpnumber -
totalTouches
-
The total number of times this Pointer has been touched to the touchscreen.
- Default Value:
- 0
- Source:
Properties:
Name Type Description totalTouchesnumber -
withinGame
-
Description.
- Source:
Properties:
Name Type Description withinGameboolean -
<readonly> worldX
-
Gets the X value of this Pointer in world coordinates based on the world camera.
- Source:
Properties:
Name Type Description durationnumber 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 durationnumber 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 xnumber -
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 ynumber
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 durationnumber <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 durationnumber <optional>
- Source:
Returns:
- Type
- boolean
-
leave(event)
-
Called when the Pointer leaves the target area.
Parameters:
Name Type Description eventAny - Source:
-
move(event)
-
Called when the Pointer is moved
Parameters:
Name Type Description eventAny - 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 eventAny - Source:
-
stop(event)
-
Called when the Pointer leaves the touchscreen.
Parameters:
Name Type Description eventAny - Source:
-
toString() → {string}
-
Returns a string representation of this object.
- Source:
Returns:
A string representation of the instance.
- Type
- string
-
update()
-
Description.
- Source: