类型 函数 返回值 数字 修订版 发行版 2024.3703 关键词 动画、补间、插值、获取持续时间 另请参阅 补间 animation.*
object:getDuration()
方法会以毫秒为单位返回 Tween 的持续时间。
此值会受到补间的 速度缩放 影响。
在无限补间(无限迭代)的情况下,此值将为 nil
,因为实际上不存在
object:getDuration()
local object1 = display.newRect( 50, 50, 100, 100 ) -- Move the object local newTween = animation.to( object1, { x=150, y=400 }, { time=5000, delay=1000 } ) -- Get the animation's playing duration local duration = newTween:getDuration() print( duration ) --> 5000