new Touch(game)
Phaser.Touch handles touch events with your game. Note: Android 2.x only supports 1 touch event at once, no multi-touch.
Parameters:
Name | Type | Description |
---|---|---|
game |
Phaser.Game | A reference to the currently running game. |
- Source:
Members
-
callbackContext
-
- Source:
Properties:
Name Type Description callbackContext
Phaser.Game Description.
-
game
-
- Source:
Properties:
Name Type Description game
Phaser.Game Local reference to game.
-
preventDefault
-
- Default Value:
- true
- Source:
Properties:
Name Type Description preventDefault
boolean Description.
-
touchCancelCallback
-
- Default Value:
- null
- Source:
Properties:
Name Type Description touchCancelCallback
Description Description.
-
touchEndCallback
-
- Default Value:
- null
- Source:
Properties:
Name Type Description touchEndCallback
Phaser.Game Description.
-
touchEnterCallback
-
- Default Value:
- null
- Source:
Properties:
Name Type Description touchEnterCallback
Phaser.Game Description.
-
touchLeaveCallback
-
- Default Value:
- null
- Source:
Properties:
Name Type Description touchLeaveCallback
Phaser.Game Description.
-
touchMoveCallback
-
- Default Value:
- null
- Source:
Properties:
Name Type Description touchMoveCallback
Phaser.Game Description.
-
touchStartCallback
-
- Default Value:
- null
- Source:
Properties:
Name Type Description touchStartCallback
Phaser.Game Description.
Methods
-
consumeTouchMove()
-
Consumes all touchmove events on the document (only enable this if you know you need it!).
- Source:
-
disabled() → {boolean}
-
You can disable all Input by setting disabled = true. While set all new input related events will be ignored.
- Source:
Returns:
- Type
- boolean
-
onTouchCancel(event)
-
Touch cancel - touches that were disrupted (perhaps by moving into a plugin or browser chrome). Occurs for example on iOS when you put down 4 fingers and the app selector UI appears.
Parameters:
Name Type Description event
Any - Source:
-
onTouchEnd(event)
-
Description.
Parameters:
Name Type Description event
Any - Source:
-
onTouchEnter(event)
-
For touch enter and leave its a list of the touch points that have entered or left the target. Doesn't appear to be supported by most browsers on a canvas element yet.
Parameters:
Name Type Description event
Any - Source:
-
onTouchLeave(event)
-
For touch enter and leave its a list of the touch points that have entered or left the target. Doesn't appear to be supported by most browsers on a canvas element yet.
Parameters:
Name Type Description event
Any - Source:
-
onTouchMove(event)
-
Description.
Parameters:
Name Type Description event
Any - Source:
-
onTouchStart(event)
-
Description.
Parameters:
Name Type Description event
Any - Source:
-
start()
-
Starts the event listeners running.
- Source:
-
stop()
-
Stop the event listeners.
- Source: