Touch Class
Global utility for working with multi-touch enabled devices in EaselJS. Currently supports W3C Touch API (iOS and modern Android browser) and IE10.
Ensure that you disable touch when cleaning up your application. Note that you do not have to check if touch is supported to enable it, as it will fail gracefully if it is not supported.
Example
var stage = new createjs.Stage("canvasId");
createjs.Touch.enable(stage);
Note: It is important to disable Touch on a stage that you are no longer using:
createjs.Touch.disable(stage);
Item Index
Methods
- _handleEnd
- _handleMove
- _handleStart
- _IE_enable static
- _IE_enable static
- _IE_handleEvent static
- _IOS_disable static
- _IOS_enable static
- _IOS_handleEvent static
- disable static
- enable static
- isSupported static
Methods
_handleEnd
()
protected
_handleMove
()
protected
_handleStart
()
protected
_IE_handleEvent
()
protected
static
_IOS_handleEvent
()
protected
static
disable
-
stage
Removes all listeners that were set up when calling Touch.enable on a stage.
Parameters:
-
stage
StageThe stage to disable touch on.
enable
-
stage
-
[singleTouch=false]
-
[allowDefault=false]
Enables touch interaction for the specified EaselJS stage. Currently supports iOS (and compatible browsers, such
as modern Android browsers), and IE10. Supports both single touch and multi-touch modes. Extends the EaselJS
MouseEvent model, but without support for double click or over/out events. See MouseEvent.pointerID
for more information.
Parameters:
-
stage
StageThe stage to enable touch on.
-
[singleTouch=false]
Boolean optionalIf true, only a single touch will be active at a time.
-
[allowDefault=false]
Boolean optionalIf true, then default gesture actions (ex. scrolling, zooming) will be allowed when the user is interacting with the target canvas.