anhoppe
anhoppe

Reputation: 4507

Can I save a TiledMap in libGDX?

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?

Upvotes: 1

Views: 1186

Answers (1)

noone
noone

Reputation: 19776

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.

Upvotes: 2

Related Questions