Touch#Touch

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. You should not normally access this class directly, but instead use a Phaser.Pointer object which normalises all game input for you. Parameters Name Type Description game Phaser.Game A reference to the currently running game. Source code: input/Touch.js (Line 16)

Touch#touchCancelCallback

touchCancelCallback : Function A callback that can be fired on a touchCancel event. Source code: input/Touch.js (Line 72)

Touch#preventDefault

preventDefault : boolean If true the TouchEvent will have prevent.default called on it. Default Value true Source code: input/Touch.js (Line 78)

Touch#removeTouchLockCallback()

removeTouchLockCallback(callback, context) → {boolean} Removes the callback at the defined index from the Phaser.Touch.touchLockCallbacks array Parameters Name Type Description callback function The callback to be removed. context object The context in which the callback exists. Returns boolean - True if the callback was deleted, otherwise false. Source code: input/Touch.js (Line 222)

Touch#start()

start() Starts the event listeners running. Source code: input/Touch.js (Line 132)

Touch#onTouchStart()

onTouchStart(event) The internal method that handles the touchstart event from the browser. Parameters Name Type Description event TouchEvent The native event from the browser. This gets stored in Touch.event. Source code: input/Touch.js (Line 247)

Touch#onTouchLeave()

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 TouchEvent The native event from the browser. This gets stored in Touch.event. Source code: input/Touch.js (Line 354)

Touch#onTouchEnter()

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 TouchEvent The native event from the browser. This gets stored in Touch.event. Source code: input/Touch.js (Line 327)

Touch#onTouchMove()

onTouchMove(event) The handler for the touchmove events. Parameters Name Type Description event TouchEvent The native event from the browser. This gets stored in Touch.event. Source code: input/Touch.js (Line 376)

Touch#game

game : Phaser.Game A reference to the currently running game. Source code: input/Touch.js (Line 21)