I wonder that there are some ways to get the current position.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | --a.lua function new() local a = display.newImage("a.png") function touchHandle(e) -- print(e.phase) if (e.phase == "began") then a.x = e.x; a.y = e.y; end if (e.phase == "ended") then a.x = 10000; a.y = 10000; end end Runtime:addEventListener("touch", touchHandle); return a; |
Did you try printing a.x and a.y during both the "began" and "ended" phases? (And including event x and y in "began"?)
What were the results?
@peach
the result is same