How to draw tiled map in Android studio with libgdx

255 Views Asked by At
mapLoader = new TmxMapLoader ();
map = mapLoader.load ( "saa.tmx" );
renderer = new OrthogonalTiledMapRenderer ( map );

My error is :

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.SerializationException: Error parsing file: saa.tmx

How to solve this problem?

1

There are 1 best solutions below

0
Stampler On

It seems like libGDX can't find the file.

  • Is the path correct? (It starts in your "anroid/assets" folder)
  • Maybe try using Gdx.files.internal("saa.tmx") or rather Gdx.files.internal("saa.tmx").path()