I think it would be like too cool if the screen would show you the coordinates of your cursor (like in photoshop, illustrator, etc.) so you don’t have to do any guessing as to where you want your objects to be. [import]uid: 66117 topic_id: 17124 reply_id: 317124[/import]
@k96
Using the JayantV`s tip is one way.
But if you run his chunk it will give you an error about the event.
To fix this error, just use the following fixed code:
[lua]local function onTouch(event)
print("POS.X = " … event.x, "POS.Y = "… event.y)
end
Runtime:addEventListener(“touch”,onTouch)[/lua]
After running it youll see printed in the terminal window the X and Y coordinates of the touch and so you can get the exactly wanted display
s position.
Regards,
Rodrigo. [import]uid: 89165 topic_id: 17124 reply_id: 64423[/import]
there is… but in which application?
if you want it in your own app, use this
local function onTouch(event)
print(event.x, event.y)
end
Runtime:addEventListener("touch",onTouch)
cheers,
?
UPDATE: Thanks Rodrigo, I missed to put the event in the function, typing code in this reply window is not fun and illustrating *basic* stuff like this does not take much attention really. [import]uid: 3826 topic_id: 17124 reply_id: 64420[/import]
Aw, man!!! I never even thought about making a function!!!
Much appreciated,
J.C.
[import]uid: 66117 topic_id: 17124 reply_id: 64494[/import]