Вопрос

So I have a map which I have gotten the cells from and stored in a cell 2d array

Cells[][] cells;

My question is if I click one of the cells on the map, how do I get the cell that was clicked (X,Y).

Это было полезно?

Решение

You do get the world coordinates form the clickevent. After that you calculate which tile it would be thats touched.
You take the x value of the touch devide it by the Tilesize same for y. After that you cast it to an integer and you do have the x,y values for the tile that is touched.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top