Type Function Return value none Revision Release 2022.3683 Keywords animation, tween, timeline, interpolation, resume See also Animation — Tweens and Timelines (guide) animation.pause() Tween Timeline
The animation.resume()
function resumes the following, depending on the passed parameter:
Calls to this method which target specific child tweens within a Timeline are ignored. Timeline tweens are controlled/owned by the parent timeline, so you should resume the timeline itself via this method or object:resume().
animation.resume() animation.resume( tweenObject ) animation.resume( displayObject ) animation.resume( tagName ) animation.resume( timelineObject )
DisplayObject. The display object upon which all paused tweens will be resumed.
String. The tag name; all paused tweens with this tag will be resumed.
local object1 = display.newRect( 50, 50, 100, 100 ) local object2 = display.newRect( 50, 150, 100, 100 ) local tween1 = animation.to( object1, { y=300 }, { time=400 } ) local tween2 = animation.to( object2, { y=400 }, { time=200 } ) -- At some point, pause all tweens and timelines animation.pause() -- Sometime later, resume them animation.resume()
local object1 = display.newRect( 50, 50, 100, 100 ) local object2 = display.newRect( 50, 150, 100, 100 ) local tween1 = animation.to( object1, { y=300 }, { time=400 } ) local tween2 = animation.to( object2, { y=400 }, { time=200 } ) -- At some point, pause a specific tween animation.pause( tween1 ) -- Sometime later, resume it animation.resume( tween1 )
local object1 = display.newRect( 50, 50, 100, 100 ) local tween1 = animation.to( object1, { y=300 }, { time=2000 } ) local tween2 = animation.to( object1, { rotation=90 }, { time=1000, delay=1000 } ) -- At some point, pause all tweens on the object animation.pause( object1 ) -- Sometime later, resume them animation.resume( object1 )
local object1 = display.newRect( 50, 50, 100, 100 ) local object2 = display.newRect( 50, 150, 100, 100 ) local tween1 = animation.to( object1, { y=300 }, { time=400, tag="tweenTag" } ) local tween2 = animation.to( object2, { y=400 }, { time=200, tag="tweenTag" } ) -- At some point, pause all tweens with the tag "tweenTag" animation.pause( "tweenTag" ) -- Sometime later, resume them animation.resume( "tweenTag" )