Universal Tween Engine 6.2.0
I updated the tween engine to 6.2.0. This release proposes some very anticipated features, such as waypoints (with bezier paths!), higher precision for timings, and a static collection of easing equation, to easily find them.
- + added a lot more precision to timings by changing ints to floats.
- + added paths for tweens through the ‘waypoint()’ method, no more linear transitions!
- + added bezier paths (this is the default if you use waypoints).
- + added TweenPaths static collection for paths implementations.
- + added TweenEquations static collection for easing equations.
- + added delay() to timelines too.
- + Aadded a completely new demo to promote the engine!
- improved performances by removing a lot of useless computations.
- greatly reduced the memory footprint of each tween object.
- object pooling is not enforced everywhere.
- [api break] callback registration was changed to reduce memory footprint.
- ! fixed a few potential bugs with kill() method and with timelines.
Project page: http://code.google.com/p/java-universal-tween-engine/
Download page: http://code.google.com/p/java-universal-tween-engine/downloads/list
Floating precision for timings
Before the update, timings were usually represented as milliseconds in integer precision. The drawback was that you couldn’t slow the animation to a speed lower than 1 ms/update. This is now over. However, your previous codes are still compatible! Indeed, the engine is now unit-independent. This means that you can use seconds, milliseconds or any unit that suits your needs, as long as you use the same unit everywhere of course.
A tween can now follow waypoints before reaching the target values. Just add some
.waypoint() calls to your tween decalrations. By default, the path will be followed with a catmull-rom spline, for a smooth path, but other implementations will be available by calling the
Note: if you want to use waypoints, you first need to call once
Tween.setWaypointsLimit() at the start of your program, because by default no memory is allocated for waypoints (in order to save it as much as possible).
TweenEquations class lists all the available easing equations, so you don’t have to use
Cubic.INOUT, etc. anymore. It will make the life of new users easier.
New API for callbacks
Sorry, I broke the api a bit for the callbacks :p It was a required change however, in order to reduce a lot the memory footprint of tweens. Now, only one callback is available per tween object through the
.setCallback() method. By default, the callback will be triggered at the completion of the tween, but you can set every triggers you want for this callback with the
That’s all you need to know, the rest is internal optimization to improve the execution speed as much as possible.
Have fun :)
Oh, now that I think about it, I also completely changed the test project into a complete demo. I really recommend you to have a look at it. More information about it in the next post ;)