New Maps API in master

Update: the docs are up on the Wiki

I just pushed the new maps API to master. Currently working on a Wiki article and converting a Google Doc by Siondream and Nex to a blog post.

You can check out a demo platformer here. Simple physics + destructable blocks.


You can check out the tests for Tiled (here, here) and Tide maps (here, here), the benchmark and the Gleed test. Warning, Gleed is a bit ugh, Siondream did his best to unfucktorize it, but it may disappear as it stores image file paths in an absolute way.

Over the next few days and weeks we’ll improve what we have in terms of performance and features, e.g. animated tiles.

Super special thanks to Siondream and Nex for putting their weight behind this!

18 thoughts on “New Maps API in master

  1. WooHoo! Great to hear that it is here.
    Also good to know that animated tiles may happen.

    Keep up the great work!

  2. Looks interesting, the mapping was one of the things doing my head in (cue conversations with Mario and SionDreams on twitter and me being very apologetic for being a twat), looking at the koalio demo it seems to be pretty cool (I went away and did some DIY tilemap rendering stuff to get a better appreciation of the complexities involved and it’s fair to say I now appreciate your work much more! I can do it but your way is easier and faster). So, once again, thank you for your hard work Mario, SionDreams and Nex, despite my gripes about documentation, LibGDX is definitely the best way to get the most out of lwjgl without spending hours faffing with opengl madness.

  3. I hear you. The maps docs are in the process of being finished up. If you think you can help out after familiarizing yourself with them, feel free to drop a pull request!

  4. Been playing with this today. I can’t for the life of me figure out how to get the properties of a tile in a tileset. They don’t appear to be loaded in the properties of the tileset for the specific tile nor in the TiledMapTile properties. In this image, properties should not be null for the StaticTiledMapTile. The one above for the tileset isn’t null, but it has no properties actually loaded into it. Am I doing something wrong, or is this just not implemented yet?

  5. I think that one of the problems is it’s loading the keys as the column header in tiled (“name” and “value”):

    And here is how I defined it in Tiled:

    Shouldn’t the key be “test” and the value be “ing”?

    I just forced the variable “name” to be the string “name” and that made it pull back the value “test” instead of null.

    String value = property.getAttribute(name, null);

  6. Andrew,

    Ugh, there were indeed some silly mistakes in the property loading from tmx.

    I fixed it just now (and pushed to GitHub), so it should be in the next nightlies. If I speak to Mario sooner, I’ll have him kick off a new build. Thanks again for reporting, sorry for the inconvenience.

  7. Been having a little play with rendering a map from tIDE and it’s about 2902803830380 times better than last time I tried (using tmx admittedly). Seems pretty logical, and the documentation is making sense, I thoroughly applaud the work of all involved.

  8. Is there a way to get size of map (in tiles) and size of tile (in pixels) now?.. Documentation doesn’t mention it…

  9. Igor,

    Because the Map class is not inherently tile-based, and TiledMapTileLayer is not required to have the same number of tiles or same size of tile per layer, these are not directly accessible from the Map or TiledMap. You could iterate over the layers and calculate it though.

  10. Width and height of the map are part of the metadata in the tmx file. I feel like those should be loaded in and be accessible from the TiledMap class rather than just the TiledMapTileLayer class:

    Also, I noticed the map objects don’t have all of the metadata loaded in. My map object had the “type” metadata loaded in but it was missing others such as x, y, etc. I added them in myself real quick in TmxMapLoader: (too lazy to do null checks, seems like we should just add a function in to make it cleaner)

    String type = element.getAttribute(“type”, null);
    String xAttribute = element.getAttribute(“x”, null);
    String yAttribute = element.getAttribute(“y”, null);
    object.getProperties().put(“x”, xAttribute);
    object.getProperties().put(“y”, yAttribute);
    if (type != null) {
    object.getProperties().put(“type”, type);

  11. The TiledMap is not specific to the Tmx format (or the application named Tiled). We’ll probably parse them as properties instead of adding them as fields. I’ll work on that tonight.

  12. I am having issues where the map sometimes flickers a grid of the clear color in the background when updating the camera.

    Is this a known issue?

Leave a Reply

Your email address will not be published.