CAAT.Foundation.Actor
Actors touch events
CAAT offers out-of-the-box multitouch support.
The framework, is smart enough to route to any given actor, only touch information relating to it. So multitouch events on a canvas/DOM element, can lead to touch events being routed to different actors.
Multitouch, is disabled by default in favor of a touch-as-mouse multitouch behavior. CAAT can't switch from touch-as-mouse to multitouch at will, so this feature must be selected previously to creating a CAAT.Director object instance.
Gestures, where available, and if the actor has setGestureEnabled(bool) will also be delivered to the actor identified by the first registered touch event.
The CAAT.TOUCH_BEHAVIOR internal variable can be assigned to:
Touch events, will be notified to the following Actor functions:
Gestures, when explicitly enabled on an Actor, will be notified to the following Actor functions:
Each device, will support a different number of touch events at the same time. Regardless of this number, CAAT will find each touch affected Actor, and call those Touch handling methods with an instance of CAAT.TouchEvent. This class, resembles a regular browser touch event object, and contains touch information in its members:
Refer to this demo with a touch enabled device to test its multitouch capabilities.