We have introduced transitions in Chapter 3, Building our First Game: Breakout and briefly touched base with it. Let's go into more detail with them.
The transition library allows you to create animations with only a single line of code by allowing you to tween one or more properties of a display object. We discussed the basics of transitions back in Chapter 3, Building our First Game: Breakout.
This can be done through the transition.to
method, which takes a display object and a table containing the control parameters. The control parameters specify the duration of the animation and the final values of properties for the display object. The intermediate values for a property are determined by an easing function that is also specified as a control parameter.
transition.to()
: Animates a display object's properties over time using the easing
transitions.
Syntax: handle = transition.to( target, params )
Parameters used are as follows:
target
: A display object...