Skip to content

Commit

Permalink
Add support for Tiled map GID object property in AtlasTmxMapLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanetaft committed Jun 2, 2013
1 parent 9882347 commit 801bac4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Expand Up @@ -533,6 +533,10 @@ protected void loadObject (MapLayer layer, Element element) {
if (type != null) {
object.getProperties().put("type", type);
}
int gid = element.getIntAttribute("gid", -1);
if (gid != -1) {
object.getProperties().put("gid", gid);
}
object.getProperties().put("x", x);
object.getProperties().put("y", yUp ? y - height : y);
object.setVisible(element.getIntAttribute("visible", 1) == 1);
Expand Down
4 changes: 4 additions & 0 deletions gdx/src/com/badlogic/gdx/maps/tiled/AtlasTmxMapLoader.java
Expand Up @@ -598,6 +598,10 @@ protected void loadObject (MapLayer layer, Element element) {
if (type != null) {
object.getProperties().put("type", type);
}
int gid = element.getIntAttribute("gid", -1);
if (gid != -1) {
object.getProperties().put("gid", gid);
}
object.getProperties().put("x", x);
object.getProperties().put("y", yUp ? y - height : y);
object.setVisible(element.getIntAttribute("visible", 1) == 1);
Expand Down

0 comments on commit 801bac4

Please sign in to comment.