简体   繁体   中英

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? If so, how would I go about getting it?

Just check it with enterFrame listener in Runtime or use a timer that triggers continously.

Timer method:

local function checkPos_withTimer()
   print(yourObject.x)
   print(yourObject.y)
end
timer.performWithDelay(1,withTimer,-1)

or

use enterFrame check:

local function checkin_frames()
   print(yourObject.x)
   print(yourObject.y)
end
Runtime:addEventListener("enterFrame",checkin_frames)

Keep coding......... :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM