CreateJS / TweenJS

A simple but powerful tweening / animation library for Javascript. Part of the CreateJS suite of libraries.
http://createjs.com/
MIT License
3.56k stars 966 forks source link

how to move backwards #68

Closed jahlomp closed 9 years ago

jahlomp commented 9 years ago

I have a shape I have moved on the x axis from 0 to 20. How do i move it backwards? i.e.move it on the x axis from 20 to 0.

lannymcnie commented 9 years ago

This is not an issue with the library. Please post future questions to StackOverflow, or other programming forums.

To answer your question, TweenJS just tweens between the numbers. If you tween from 20 to 0, it will have the desired effect.

shapeInstance.x = 20;
createjs.Tween.get(shapeInstance).to({x:0}, 5000);

Cheers.