Type Function Return value none Revision Release 2024.3703 Keywords animation, timeline, interpolation, setSpeedScale See also object:getSpeedScale() animation.setSpeedScale() Timeline animation.*
Sets the playback speed scale of a Timeline created with animation.newTimeline().
Changing the speed scale does not affect any delay set for starting the timeline playback. In other words, only the actual playing portion of the timeline will be modified by this method.
object:setSpeedScale( scale )
Number. The relative speed scale. This must be a positive number greater than 0
. By default, the speed scale is 1
(normal speed). Values greater than 1
will increase the speed while values lower than 1
will decrease it.
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 speed scale newTimeline:setSpeedScale( 2.5 ) -- Set the timeline playing newTimeline:resume()