Im new to Corona, Lime, Lua and even mobile applications :P, and dont understand very well how to make some things to work.
I would like some help, because Im trying to get a tile object out of screen x and y positions(event.x, event.y) in an isometric map, whenever someone clicks on a tile. The problem is the tile always returns nil(I have tried to get the positions right, but nothing I have done works, so I would like some help
I thank you before hand, for taking the time to read this and helping if you can.
Here’s the last code I tried to make this work:
--Converting screen position to world...
local screenToWorld = lime.utils.screenToWorldPosition(map, event)
--...then to isometric
local isoPosition = lime.utils.worldToIsometricPosition(map, screenToWorld)
--tile now is nil
--returned isoPosition.x would be something like 2, then just a little to the right would be -5.5
local tile = grassLayer:getTileAt(isoPosition,false)
I have tried to get the tile with the positions returned by functions(like worldToIsometricPosition(), IsometricToWorldPosition(), screenToGridPosition(), regular event.x and event.y, sending event as the position), but nothing so far has worked. I really appreciate any help, and it would be great if somebody could explain to me the difference between map, grid and world(as I dont know whats the difference will be between the position returned by all of these) or point to a tutorial or something of the sort [import]uid: 109816 topic_id: 19147 reply_id: 319147[/import]