Thursday, 2 May 2013

TweenJS: Overriding Tweens


If you create two tweens for a single object, they will both run together, and as long as you don't try to tween the same property at the same time, it should be fine.

If you want, you can override a tween, and two ways to do this are shown in lines 16 and 17 (on line 16, the fourth parameter of the get function is the override, the third is some kind of plugins object that I don't understand right now...).

On line 15, I have also shown a way to call the console, for the Flashers, this is like trace(). To see the calls to the console on Mozilla Firefox, go to Tools, Web Developer, Web Console.

Both of these tweens use the loop parameter, so that the animation keeps on going round and round.

No comments:

Post a Comment

Please enter your message here...