Tiled map with more than 1 tileset not rendering correct

Anything libgdx related goes here!

Re: Tiled map with more than 1 tileset not rendering correct

Postby pato22 » Mon Jan 06, 2020 7:25 pm

But if i use either of the tilesets alone it works properly so they are good defined. This problem only occurs when the map have more than one tileset, but when using one of the tilesets alone they are working.
So i dont understand where is the error.
Tried setting the tsx file and the png files in the same dir as you suggest but not working neither
pato22
 
Posts: 6
Joined: Mon Jan 06, 2020 2:14 am

Re: Tiled map with more than 1 tileset not rendering correct

Postby shatterblast » Mon Jan 06, 2020 7:58 pm

You might try using TmxMapLoader through an AssetManager, like below. If you aren't using LibGDX 1.9.10 yet, then upgrading to that would be the following step. Otherwise, I don't know what else to tell you.

Code: Select all
AssetManager manager = new AssetManager();
manager.setLoader(TiledMap.class, new TmxMapLoader());
manager.load("maps/level.tmx", TiledMap.class);
manager.finishLoading();
TiledMap map = manager.get("maps/level.tmx", TiledMap.class);
shatterblast
 
Posts: 653
Joined: Sun Jul 06, 2014 1:14 pm

Re: Tiled map with more than 1 tileset not rendering correct

Postby mgsx » Mon Jan 06, 2020 9:51 pm

this issue may be related to some bugs in libgdx 1.9.9 and 1.9.10. It's fixed on master branch.

so, tilemaps are fine with libgdx 1.9.8 and 1.9.11-SNAPSHOT :-)
mgsx
 
Posts: 14
Joined: Wed Oct 26, 2016 11:01 am

Previous

Return to Libgdx

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 1 guest