|
Tween
Description of tweens and their options.
Featured IntroductionA Tween defines an interpolation that will modify one or many attribute(s) of an object during a specified time. This modification can be done smoothly and with various effects easily, this is the main purpose of Tweens !
Different tweens for different goalsThe easiest way to create a tween is to use one of the static constructors:
Some explanations:
Of course, Tween.set() and Tween.call() are best used with a delay applied to them. See below for options such as delays. Don't forget the targets !The previously listed tweens are useless if you do not specify their target values. Just call the .target() method on your tweens. Since there are many overloads for this method, it is not included in the static constructors. Just don't forget it ;-) The method returns the current tween, so you can easily chain it: Tween.to(...).target(x, y, z); OptionsMany options can be added to your tweens. Most of these optional methods return the current tween, so you can chain them in one line.
Combined TweensCombined tweens are tweens that act on more than one attribute at a time. Just return a number higher than 1 in the getValues() method of the TweenAccessor interface for some tween type, and you can use Tween.to()/.from()/.set() with many attributes at a time. Tween.to(myObject, MY_COMBINED_TYPE, 1.0f).target(value1, value2, value3); Its a very powerful feature, especially useful when you want to tween, for instance, the position of an object as a whole XY position, and not with two tweens (one for X, one for Y). |