Hi, I am having a real hard time figuring out how to get the tile (indicies) after a button press on a tiled map. If the map as not scrolled, I can work it out, but if I drag the map .... I cannot figure it out.
You can use Sprite:globalToLocal function to map a global coordinate (e.g. event.x, event.y) to the local coordinate system of the map. Even if you drag (or scale and rotate) the map, this function gives same coordinate on the map.
Comments
You can use Sprite:globalToLocal function to map a global coordinate (e.g. event.x, event.y) to the local coordinate system of the map. Even if you drag (or scale and rotate) the map, this function gives same coordinate on the map.