Search in sources :

Example 21 with TiledMapTile

use of com.badlogic.gdx.maps.tiled.TiledMapTile 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

TiledMapTile (com.badlogic.gdx.maps.tiled.TiledMapTile)21 Cell (com.badlogic.gdx.maps.tiled.TiledMapTileLayer.Cell)17 TiledMapTileLayer (com.badlogic.gdx.maps.tiled.TiledMapTileLayer)12 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)10 MapProperties (com.badlogic.gdx.maps.MapProperties)10 StaticTiledMapTile (com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile)7 GameEngine (com.relic.highflyer.GameEngine)7 GameSettings (com.relic.highflyer.GameSettings)7 GameState (com.relic.highflyer.GameState)7 ScreenManager (com.relic.highflyer.screens.ScreenManager)7 ArrayList (java.util.ArrayList)7 Test (org.junit.Test)7 Color (com.badlogic.gdx.graphics.Color)4 TiledMap (com.badlogic.gdx.maps.tiled.TiledMap)4 AnimatedTiledMapTile (com.badlogic.gdx.maps.tiled.tiles.AnimatedTiledMapTile)4 Screen (com.badlogic.gdx.Screen)3 Tile (objects.Tile)3 OrthographicCamera (com.badlogic.gdx.graphics.OrthographicCamera)2 Texture (com.badlogic.gdx.graphics.Texture)2 TextureAtlas (com.badlogic.gdx.graphics.g2d.TextureAtlas)2