Type Function Library transition.* Return value Object Revision Release 2024.3703 Keywords easing, animation, transition, tween, interpolation
Moves an object to the specified x
and y
coordinates and back, creating a loop.
time
is used for a full cycle and the easing is reversed in the second half of the transition.
transition.loop( target, params )
Table. Any object that behaves like a table, for example display objects.
Table. A table that specifies the properties of the transition — see the next section for details.
Number. The time of the action.
String. Specifies the transition tag. The transition library can pause, resume, or cancel transitions sharing the same tag.
Number. Specifies the number of iterations for which the transition will repeat. By default, the iteration value is 1
.
Number. Specifies the delay, in milliseconds, before the transition begins. Default is 0
.
Number. Moves the target from its current x coordinate to another.
Number. Moves the target from its current y coordinate to another.
Listener. Listener function to be called before the transition begins. This function will receive a reference to the associated object as its sole argument.
Listener. Listener function to be called after the transition completes. This function will receive a reference to the associated object as its sole argument.
Listener. Listener function to be called when the transition is paused. This function will receive a reference to the associated object as its sole argument.
Listener. Listener function to be called when the transition is resumed. This function will receive a reference to the associated object as its sole argument.
Listener. Listener function to be called when the transition is cancelled. This function will receive a reference to the associated object as its sole argument.
local square = display.newRect( 0, 0, 100, 100 ) transition.loop( square, { time = 2000, y = 100, iterations = 20, transition = easing.inOutQuad } )