[英]Obtaining position during transition.to in Corona SDK
I was wondering if it was possible to obtain a sprite x and y coordinates during a transition.to animationin using Corona SDK in lua? 我想知道是否可以在lua中使用Corona SDK过渡到animationin期间获得精灵x和y坐标? If so, how would I go about getting it?
如果是这样,我将如何获得它?
Just check it with enterFrame
listener in Runtime or use a timer
that triggers continously. 只需在Runtime中使用
enterFrame
侦听器对其进行检查,或使用可连续触发的timer
。
Timer method: 计时器方法:
local function checkPos_withTimer()
print(yourObject.x)
print(yourObject.y)
end
timer.performWithDelay(1,withTimer,-1)
use enterFrame check: 使用enterFrame检查:
local function checkin_frames()
print(yourObject.x)
print(yourObject.y)
end
Runtime:addEventListener("enterFrame",checkin_frames)
Keep coding......... :) 继续编码......... :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.