as the title says, i'm trying to get the screen coordinates for each cell in my map. is it even possible? I'm really frustraited and can't figure it out! I appreciate your help! note that my map has a static position on the screen.
Another note: i have a custom class Cell that extends Actor. I made it to make my cells clickable and it looks like this:
public class Cell extends Actor {
private TiledMapTileLayer.Cell tiledMapCell;
private Texture cellTexture;
public Cell(TiledMapTileLayer.Cell tiledMapCell, Field field){
this.tiledMapCell = tiledMapCell;
this.field = field;
this.cellTexture = tiledMapCell.getTile().getTextureRegion().getTexture();
}
public TiledMapTileLayer.Cell getTiledMapCell(){
return this.tiledMapCell;
}
public Texture getCellTexture(){
return this.cellTexture;
}
public void setCellTexture(Texture texture){
this.cellTexture = texture;
this.tiledMapCell.setTile(new StaticTiledMapTile(new TextureRegion(cellTexture)));
Thanks!!
You can process like this :
In your Cell class add a new Variable to get the position of the tile.
Change your constructor.
In your main class get the number of tiles in the width of your map, do the same for the height and the size of a tile.
now use a loop
This is the method i use cause i did not find any other way.