local function yourFunction()
print("This will get called 5seconds after block[old] transition...")
end
local function transitionFinished()
print("Transition of block[old] is completed...")
timer.performWithDelay(5000,yourFunction,1) --[[ If you want, you can use this
line to call 'yourFunction'
after desired time(here 5seconds)
--]]
end
transition.to(block[old], {time=tranTime, x=block[new].x, y=block[new].y, onComplete=transitionFinished})
transition.to(block[new], {time=tranTime, x=block[old].x, y=block[old].y})
否则,如果要暂停所有的过渡,有很多自定义类,你可以使用像一个DevfaR说。
或者,如果你想执行的延迟后的过渡,你也可以使用:
transition.to(block[old], {delay=1000,time=tranTime, x=block[new].x, y=block[new].y})
-- this will get called after a delay of 1000ms --
保持编码............ :)
'计时器。如果你想要函数被调用一次,performWithDelay(5000,yourFunction)'就足够了。第三个参数,即迭代次数是可选的。 – lomza