Crafty.multitouch()

public this .multitouch(Boolean bool)
bool

Turns multitouch on and off. The initial state is off (false).

public Boolean .multitouch()
[Returns]

Whether multitouch is currently enabled;

Enables/disables support for multitouch feature.

If this is set to true, it is expected that your entities have the Touch component instead of Mouse component. If false (default), then only entities with the Mouse component will respond to touch.

If no boolean is passed to the function call, it will just return whether multitouch is on or not.

Note: The Touch component (and thus the multitouch feature) is currently incompatible with the Draggable component.

Example

Crafty.multitouch(true);

var myEntity1 = Crafty.e('2D, Canvas, Color, Touch')
   .attr({x: 100, y: 100, w:200, h:200, z:1 })
   .color('black')
   .bind('TouchStart',function(e){ alert('big black box was touched', e); }),
 myEntity2 = Crafty.e('2D, Canvas, Color, Touch')
   .attr({x: 40, y: 150, w:90, h:300, z:2 })
   .color('green')
   .bind('TouchStart',function(e){ alert('big GREEN box was touched', e); });

Crafty.log("multitouch is "+Crafty.multitouch());