类型 函数 返回值 布尔值 修订 版本 2024.3703 关键词 动画, 时间轴, 插值, getIsPaused 另请参阅 object:pause() 时间轴 animation.*
如果 时间轴 已暂停,则返回布尔值 true,否则返回 false。
object:getIsPaused()
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 playing
newTimeline:resume()
-- Sometime later, pause the timeline
newTimeline:pause()
-- Check if timeline is paused
local isPaused = newTimeline:getIsPaused()
print( isPaused ) --> true