-
Notifications
You must be signed in to change notification settings - Fork 820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add startDrag & stopDrag methods for Sprites #37
Comments
So long time... We need this feature! |
@illuzor useful troll mode why startDrag() but not startBlink()? |
Wow, it's been a while since I opened up that issue! ;-) However, I recommend you have a look at the "TouchSheet" class that's used in the Starling Demo. It implements a complete multi-touch-enabled drag solution (plus pinch and rotate), so it's for sure a good starting point for what you want to achieve. |
PrimaryFeather, thank you for answer. |
Of course! I just want to avoid that you have to wait for me to implement this before you can continue. ;-) |
I have solved the task. I am understand that implementation can`t be immediate. |
Still waiting :) |
+1 for waiting |
I must say I'm no longer sure this is really necessary, since dragging can be achieved as simple as the following: sprite.addEventListener(TouchEvent.TOUCH, onTouch);
private function onTouch(event:TouchEvent):void
{
var target:DisplayObject = event.target as DisplayObject;
var touch:Touch = event.getTouch(target, TouchPhase.MOVED);
if (target && touch)
{
var movement:Point = touch.getMovement(this);
target.x += movement.x;
target.y += movement.y;
}
} This was more complicated in the past, when there was no Are there more opinions on this? |
I`m agree. No need for dragAndDrop now |
Thanks PrimaryFeather, that worked for me! |
Perfect, thanks for the feedback! |
No description provided.
The text was updated successfully, but these errors were encountered: