Search in sources :

Example 31 with TiledMapTileLayer

use of com.badlogic.gdx.maps.tiled.TiledMapTileLayer in project ultimate-java by pantinor.

the class CombatScreen method replaceTile.

public void replaceTile(String name, int x, int y) {
    if (name == null) {
        return;
    }
    TextureRegion texture = Ultima4.standardAtlas.findRegion(name);
    TiledMapTileLayer layer = (TiledMapTileLayer) tmap.getLayers().get("Map Layer");
    Cell cell = layer.getCell(x, 11 - 1 - y);
    TiledMapTile tmt = new StaticTiledMapTile(texture);
    tmt.setId(y * 11 + x);
    cell.setTile(tmt);
    combatMap.setTile(Ultima4.baseTileSet.getTileByName(name), x, y);
}
Also used : TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) TiledMapTileLayer(com.badlogic.gdx.maps.tiled.TiledMapTileLayer) StaticTiledMapTile(com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile) TiledMapTile(com.badlogic.gdx.maps.tiled.TiledMapTile) StaticTiledMapTile(com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile) Cell(com.badlogic.gdx.maps.tiled.TiledMapTileLayer.Cell)

Aggregations

TiledMapTileLayer (com.badlogic.gdx.maps.tiled.TiledMapTileLayer)31 Cell (com.badlogic.gdx.maps.tiled.TiledMapTileLayer.Cell)18 TiledMapTile (com.badlogic.gdx.maps.tiled.TiledMapTile)12 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)11 StaticTiledMapTile (com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile)9 MapLayer (com.badlogic.gdx.maps.MapLayer)7 TiledMap (com.badlogic.gdx.maps.tiled.TiledMap)7 Rectangle (com.badlogic.gdx.math.Rectangle)5 Color (com.badlogic.gdx.graphics.Color)4 MapLayers (com.badlogic.gdx.maps.MapLayers)4 TiledMapImageLayer (com.badlogic.gdx.maps.tiled.TiledMapImageLayer)4 Point (java.awt.Point)4 Tile (objects.Tile)4 Texture (com.badlogic.gdx.graphics.Texture)3 TextureAtlas (com.badlogic.gdx.graphics.g2d.TextureAtlas)3 MapProperties (com.badlogic.gdx.maps.MapProperties)3 AnimatedTiledMapTile (com.badlogic.gdx.maps.tiled.tiles.AnimatedTiledMapTile)3 OrthographicCamera (com.badlogic.gdx.graphics.OrthographicCamera)2 MapObject (com.badlogic.gdx.maps.MapObject)2 OrthoCamController (com.badlogic.gdx.tests.utils.OrthoCamController)2