Question

I just started to look into libGDX and I really enjoyed it. Loading a tile map I generated with an editor was really simple. But I have in mind to work on a game where the player can modify and extend the map.

So here is my question: Is it somehow possible to add/delete/change fields in a com.badlogic.gdx.maps.tiled.TiledMap and save the result to disc?

Was it helpful?

Solution

Unfortunately, right now there is no built-in feature to store TiledMaps.

I know only the .tmx format of TilEd, but this is a pretty easy and straight-forward XML format, which is very similar to the structure of a TiledMap. Check out how TmxMapLoader loads the TiledMap and then use an XmlWriter to write your altered maps to a file in a similar way.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top