类型 函数 返回值 补间 修订版 发布 2024.3703 关键词 动画、补间、时间轴、插值、from 另请参见 动画 — 补间和时间轴 (指南) animation.to() 补间 时间轴
与 animation.to() 类似,只是起始属性值在 properties
表中指定,并且最终值是调用之前对象的对应属性值。
animation.from( target, properties, params )
DisplayObject 或 Userdata。要进行补间的显示对象、RectPath 点、Paint 填充或 fill.effect。
Table。一个指定将进行插值的对象属性的表 - 请参阅 animation.to() 以获取常见选项列表。
Table。一个指定补间控件参数的表 - 请参阅 animation.to() 以获取参数参考。
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 } )