How to manipulate a TiledMap in libGDX?

2.2k views Asked by At

It looks like libGDX currently doesn't support changing the content of a TiledMap in game. I'd like to

  • add / remove tiles [SOLVED]
  • move objects [SOLVED]
  • serialize changes [PARTLY SOLVED]

Are there any third-party solutions addressing (at least some of) these issues? Or how to handle the "delta" in a different object model / file format.

1

There are 1 answers

0
pepan On BEST ANSWER

When I was using libgdx-0.9.8, I got to the very same trouble. When I upgraded to libgdx-0.9.9, the issue got resolved. The TiledMap API got redesigned significantly in version 0.9.9 (actually, it got completely rewritten) and they are not caching tiles anymore so changes in the map are being rendered even when made during the game loop. Just upgrade the library and rewrite your code to follow the new API. FMI, see here New Tile Maps Implementation

BTW, they are going to release version 1.0.0 next week!