
GTween + Tweener = GTweener
The perfect tweening library?As you know, creating tweens is foundational to practically any project you build using Actionscript. I've always loved using Tweener for its "set it and forget it" simplicity. Whether or not I have "old" tweens running, my objects animate the way I expect them to, and I never experience the strange results of having multiple tweens animating the same property at once.
However, other tween libraries boast greater performance than Tweener. The sacrifice you make in managing these libraries rewards you with a faster frame rate -- critical for any project that is graphic intensive.
Some time ago I saw GTween and thought its features and performance were both enough to make me consider changing from Tweener, but in the end I was happier with how simple Tweener is to manage.
Finally, I tried my hand at combining my love for Tweener's simplicity with GTween, to see if I could create a GTween manager that would still be easy to use but benefit from GTween's features and better frame rates.
BenchmarkI pitted the new library against GTween and Tweener and I was surprised by the results:
GTween: 12,015ms
Tweener: 30,532ms
GTweener: 12,657ms
10,000 objects, simultaneous x, y and alpha tween, no easingGTween: 12,406ms
Tweener: 31,313ms
GTweener: 12,657ms
10,000 objects, simultaneous x, y and alpha tween, ease out exponential*These numbers are provided to illustrate relative performance, not absolute performance against other librariesIt runs practically as fast as GTween but gives you global functions like Tweener (addTween, removeAllTweens, pauseTweens, etc.) and removes the hassle of remembering whether an object already has an active tween running. Simple like Tweener, but functions like GTween.
DownloadI packaged GTweener together with GTween Beta 4 and the Equations class from Tweener (for easing), so you can download either an example FlashDevelop project using GTweener or just the source files:
http://code.google.com/p/gtweenerFeedbackPlease leave your comments to let me know what you think and how I can improve it!