We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a new map via the following code does not finish() according to my debugging at drawTile(), all the tiles are null.
finish()
drawTile()
TmxMap map = new TmxMap(MapOrientations.ORTHOGONAL); map.setRenderOrder(RenderOrder.RIGHT_DOWN); map.setTileWidth(64); map.setTileHeight(64); map.setWidth(10); map.setHeight(10); map.setTiledVersion("1.1.5"); map.setName(name); Tileset tileset = Resources.tilesets().get("tilesheet.tsx"); map.getTilesets().add(tileset); ArrayList<Tile> tiles = new ArrayList<>(); for (int y= 0; x < 10; x++) { for (int x= 0; y < 10; y++) { int tile = 1; Tile t = new Tile(tile); t.setTileCoordinate(new Point(x,y)); tiles.add(t); } } TileData data; try { data = new TileData(tiles, width, height, TileData.Encoding.CSV, TileData.Compression.NONE); data.setValue(TileData.encode(data)); } catch (IOException e) { data = null; e.printStackTrace(); } try { System.out.println(data.getTiles()); } catch (InvalidTileLayerException e) { e.printStackTrace(); } TileLayer ground = new TileLayer(data); ground.setVisible(true); ground.setRenderType(RenderType.BACKGROUND); ground.setWidth(10); ground.setHeight(10); map.addLayer(ground); Game.world().loadEnvironment(map);
but adding the following code right before loadEnviornment() makes drawTile() function as intended.
loadEnviornment()
try {map.finish(Game.class.getClassLoader().getResource("tilesheet.tsx"));} catch (TmxException e) {e.printStackTrace();}
I could be doing something wrong here, but wanted to check in either way.
The text was updated successfully, but these errors were encountered:
This problem is addressed by the new API I introduced with 96be92d
Sorry, something went wrong.
No branches or pull requests
Creating a new map via the following code does not
finish()
according to my debuggingat
drawTile()
, all the tiles are null.but adding the following code right before
loadEnviornment()
makesdrawTile()
function as intended.I could be doing something wrong here, but wanted to check in either way.
The text was updated successfully, but these errors were encountered: