I have problems with LibGDX and striped cards. I came from the Corona SDK (Lua) and I used Lime (a third-party lib to handle tmx cards), now I switched to LibGDX and watched this really last function: GraphicsTileMaps
I managed to load an isometric map from assets using IsometricTiledMapRenderer as a visualization tool and OrthographicCamera to display a map (everything works as described on the wiki page). I could also programmatically program some fragments on the map layer, but my problem starts when I try to use AnimatedTiledMapTile :
map = new TmxMapLoader().load(...); TiledMapTileLayer layer = (TiledMapTileLayer) map.getLayers().getLayer("layer1"); TiledMapTileSet tileset = map.getTileSets().getTileSet("tileset1"); TiledMapTile grassTile = tileset.getTile(4); TiledMapTile rockTile = tileset.getTile(6); Array<StaticTiledMapTile> playerTileArr = new Array<StaticTiledMapTile>(); playerTileArr.add((StaticTiledMapTile)tileset.getTile(7)); playerTileArr.add((StaticTiledMapTile)tileset.getTile(8)); Cell grass = new Cell(); grass.setTile(grassTile); Cell player = new Cell(); player.setTile(new AnimatedTiledMapTile(0.1f, playerTileArr)); layer.setCell(0,0, grass);
Can anyone help? I found an example of using AnimatedTiledMapTile for TideMapLoader , but I know that I am using a tile map (and not a “ tide map”). However .. can someone explain how I can make animation on a specific tile?
Felice ostuni
source share