Type Function Return value none Revision Release 2024.3703 Keywords animation, tween, interpolation, setSpeedScale See also object:getSpeedScale() animation.setSpeedScale() Tween animation.*
Sets the playback speed scale of a Tween object.
Changing the speed scale does not affect any delay set for starting the playback. In other words, only the actual playing portion of the affected object(s) will be modified by this call.
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 ) -- Move the object local newTween = animation.to( object1, { x=150, y=400 }, { time=5000 } ) -- Set the tween speed scale newTween:setSpeedScale( 2.5 )