object:resume()

Type Function
Return value none
Revision Release 2024.3703
Keywords animation, timeline, interpolation, resume
See also object:pause()
animation.pause()
animation.resume()
Timeline
animation.*

Overview

Resumes a paused Timeline created with animation.newTimeline(), including all child tweens within it.

This method can also be used to start a new Timeline playing since timelines do not begin playing automatically upon creation.

Syntax

object:resume()

Example

local object1 = display.newRect( 50, 50, 100, 100 )

-- Create a timeline object
local timelineParams = {
    tweens = {
        { startTime=0, tween={ object1, { x=400 }, { time=4000, iterations=5 } } },
        { startTime=1000, tween={ object1, { y=400 }, { time=4000, easing=easing.outQuad } } }
    }
}
local newTimeline = animation.newTimeline( timelineParams )

-- Set the timeline playing
newTimeline:resume()

-- After 2 seconds, pause the timeline
timer.performWithDelay( 2000, function() newTimeline:pause(); end )

-- Sometime later, resume the timeline
newTimeline:resume()