正如标题所说,我正在尝试获取地图中每个单元格的屏幕坐标。有可能吗?我真的很沮丧,想不通!我感谢您的帮助!请注意,我的地图在屏幕上有一个静态位置。
另一个注意事项:我有一个扩展 Actor 的自定义类 Cell。我让它使我的单元格可点击,它看起来像这样:
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)));
谢谢!!