Type Function Return value Tween Revision Release 2024.3703 Keywords animation, tween, timeline, interpolation, from See also Animation — Tweens and Timelines (guide) animation.to() Tween Timeline
Similar to animation.to() except that the starting property values are specified in the properties
table and the final values are the corresponding property values of the object prior to the call.
animation.from( target, properties, params )
DisplayObject or Userdata. The display object, RectPath point, Paint fill, or fill.effect to tween.
Table. A table that specifies the properties of the object that will be interpolated — see animation.to() for a list of common options.
Table. A table which specifies control parameters for the tween — see animation.to() for parameter references.
local square = display.newRect( 0, 0, 100, 100 ) local w, h = display.contentWidth, display.contentHeight local function tweenListener( obj ) print( "Tween completed; ID: " .. obj.id ) end -- Move square from bottom right corner to upper left corner animation.from( square, { x=(w-50), y=(h-50) }, { time=1500, id="tween1", onComplete=tweenListener } )