Skip to content
Snippets Groups Projects
Commit 546495fd authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko
Browse files

#398 Added rotation animation. Changed rotation direction.

parent 9883466a
Branches
Tags
No related merge requests found
......@@ -164,8 +164,9 @@ public class DragAndRotateActorListener extends InputListener {
if (tapped) {
if (lastTouch != null) {
if (tempTouch.isDoubleTap(lastTouch)) {
lastTouch.getTouchedActor().rotateBy(90);
rotated((lastTouch.getTouchedActor().getRotation() + 90), lastTouch.getTouchedActor());
Actor actorToRotate = lastTouch.getTouchedActor();
actorToRotate.addAction(Actions.rotateTo(actorToRotate.getRotation()-90, 0.5f));
rotated(actorToRotate.getRotation() - 90, actorToRotate);
} else {
lastTouch = new Touch(draggedActor, (tempTouch.getTime() + newTouch.getTime()) / 2); //not double - save least touch
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment