fljot / Gestouch

Gestouch: multitouch gesture recognition library for Flash (ActionScript) development.
MIT License
355 stars 85 forks source link

DoubleTapGestureEvent localX bug? #1

Closed jeromedecoster closed 12 years ago

jeromedecoster commented 12 years ago

Hello,

I just downloaded Gestouch and try it on a Samsung Galaxy Tab:

DoubleTapGesture.add(stage);
stage.addEventListener(DoubleTapGestureEvent.GESTURE_DOUBLE_TAP, onDoubleTapGesture);

private function onDoubleTapGesture(event:DoubleTapGestureEvent):void {
    var sprite:Sprite = new Sprite();
 sprite.graphics.lineStyle(25, Math.random()*0xFFFFFF);
 sprite.graphics.drawCircle(0, 0, 80);
 sprite.x = event.localX;
 sprite.y = event.localY;
 addChild(sprite);
}

And the sprite is always located at x:0 y:0 (localX and stageX)

Is it a bug?

fljot commented 12 years ago

It is. Fixing...

fljot commented 12 years ago

Well looks like this small issue led to a huge refactoring. Just to inform you: with a new architecture it should work properly. See recent commit(s) in develop branch https://github.com/fljot/Gestouch/tree/develop See examples https://github.com/fljot/GestouchExamples/tree/develop

So you code now should look like: var doubleTap:TapGesture = new TapGesture(stage); doubeTap.numTapsRequired = 2; doubleTap.addEventListener(TapGestureEvent.GESTURE_TAP, onDoubleTap);