- Home /
iTween — Possible to animate then return back to original?
Seems a simple command but can't find anything in the iTween documentation. Just want to animate ColorTo then make it rewind back to the starting position then end the animation.
Closest I can find is changing the loopType to pingpong but that just continues looping forever.
Answer by robertbu · Mar 01, 2013 at 04:44 AM
One way is to use the oncomplete and oncompletetarget parameters. So you call ColorTo() once going one direction, once it completes, it will call the method you specify, and you call ColorTo() again to take the colors back.
Hmm… Yeah I saw that too. I figured this would be a common need to have something swing one way then back. I guess not. Thanks for the reply!
It was something I needed to do awhile back as well. I put in a suggestion to add the ability to iTween to take a custom easing function, which would have allowed you to do what you want plus a whole lot more.