Pergunta

When I recently tried to load a basic map I made in Tiled I get the exception: Unsupported encoding (XML) for TMX Layer Data

I looked at the tutorial from badlogicgames website and did the same thing

private TiledMap map;

public void create() {      
     map = new TmxMapLoader().load("data/jf2.tmx");
} 

Here I have put my jf2.tmx file in the assets folder. I then moved all the images files to the same directory. So basically...what am I doing wrong?

Foi útil?

Solução

Currently LibGDX (the TmxMapLoader) can't load a map where the data is encode in XML (this is default). You need to set the "Tile Layer Format" in Tiled to csv, base64, gzip or zlib. These are implemented in the current nightly build. You can set the "Layer Format" directly after opening the map in Tiled under Properties.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top