3 ## PanGestureDetector API
6 PanGestureDetector analyse a stream of touch events and looks for panning (or dragging) gestures.
7 If an actor is attached to the pan gesture detector, the detector will emit a detected signal to
8 the application when it recognises a pan gesture on the attached actor in its analysis.
13 // Create a pan gesture detector
14 var panGestureDetector = new dali.PanGestureDetector();
16 var actor = new dali.Actor();
17 dali.stage.add(actor);
19 // Attach an actor to the detector
20 panGestureDetector.attach(actor);
22 // Connect the detected signal
23 panGestureDetector.on("panDetected", onPan);
25 onPan = function(actor, panGesture)
27 log("Pan gesture state: " + panGesture.state + ", number of touches: " + panGesture.numberOfTouches + ", time stamp: " + panGesture.time + "\n");
28 log("local position: " + panGesture.position.x + ", " + panGesture.position.y + "\n");
29 log("local displacement: " + panGesture.displacement.x + ", " + panGesture.displacement.y + "\n");
30 log("local velocity: " + panGesture.velocity.x + ", " + panGesture.velocity.y + "\n");
31 log("screen position: " + panGesture.screenPosition.x + ", " + panGesture.screenPosition.y + "\n");
32 log("screen displacement: " + panGesture.screenDisplacement.x + ", " + panGesture.screenDisplacement.y + "\n");
33 log("screen velocity: " + panGesture.screenVelocity.x + ", " + panGesture.screenVelocity.y + "\n");
36 // Detach the actor from the detector
37 panGestureDetector.detach(actor);
39 @class PanGestureDetector