Class: Touch

Phaser. Touch

The Touch class handles touch interactions with the game and the resulting Pointer objects.

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

Properties:
Name Type Description
callbackContext Phaser.Game

Description.

Source:

game

Properties:
Name Type Description
game Phaser.Game

Local reference to game.

Source:

preventDefault

Properties:
Name Type Description
preventDefault boolean

Description.

Default Value:
  • true
Source:

touchCancelCallback

Properties:
Name Type Description
touchCancelCallback Description

Description.

Default Value:
  • null
Source:

touchEndCallback

Properties:
Name Type Description
touchEndCallback Phaser.Game

Description.

Default Value:
  • null
Source:

touchEnterCallback

Properties:
Name Type Description
touchEnterCallback Phaser.Game

Description.

Default Value:
  • null
Source:

touchLeaveCallback

Properties:
Name Type Description
touchLeaveCallback Phaser.Game

Description.

Default Value:
  • null
Source:

touchMoveCallback

Properties:
Name Type Description
touchMoveCallback Phaser.Game

Description.

Default Value:
  • null
Source:

touchStartCallback

Properties:
Name Type Description
touchStartCallback Phaser.Game

Description.

Default Value:
  • null
Source:

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:
Phaser Copyright © 2012-2013 Photon Storm Ltd.
Documentation generated by JSDoc 3.2.0-dev on Thu Oct 03 2013 02:35:50 GMT+0100 (BST) using the DocStrap template.