LibGDX - Loading ImageMapObjects?

Curious how to go about the drawing of the ImageMapObjects? I’ve created my entire level-layout using them for placing my animated doors, ladders, chains, and even traps/obsticles, but it turns out that LibGDX doesn’t render it by default.

I’ve done some googling, but I can’t really figure out how to get them to draw.

Thanks in advance for any help.

SOLVED: Thanks to DermetFan

I think you mean TextureMapObjects. If you place an image on the tile map, the TmxMapLoader will not create a TextureMapObject from it.
It will be RectangleMapObject with a “gid” property instead.
You could override the OrthogonalTiledMapRenderer#renderObject(MapObject) method. It does nothing by default, but you can do this:


@Override
        public void renderObject(MapObject object) {
            if(object instanceof RectangleMapObject) {
                RectangleMapObject rectObj = (RectangleMapObject) object;
                if(rectObj.getProperties().containsKey("gid")) {
                    TiledMapTile tile = getMap().getTileSets().getTile(rectObj.getProperties().get("gid", Integer.class));
                    spriteBatch.draw(tile.getTextureRegion(), rectObj.getRectangle().x, rectObj.getRectangle().y);
                }
            }
        }

So… Why can’t you make your own parser? It wouldn’t be hard if all we are talking about is an image with a map saved in it.

Dermetfan pointed out the problem for me in another location, although Tiled Refers to them as ImageMapObjects on their web-page, they are actually TextureMapObjects, the problem with this is that the TextureMapObjects are actually just RectangleMapObjects with a GID Property, I would have never figured that out on my own, however it’s all working now.