Okay, so I am officially stumped,
I am making a 2D top-down game using libGDX. I make my tiled maps using TILED.
Is there a way to order/sort the map objects so they display in the correct z-order on a specific object layer.
All I really need is for the one entity to look like they are standing in front of another entity on the same object layer.
I overrode the BatchTileMapRenderer so that the map object (which I made from another Entity class) are actually displayed when you render the map
public class MapRenderer extends BatchTiledMapRenderer{
@override
public void renderObject(MapObject object) {
if(object instanceof Entity) {
Entity ent = (Entity) object; ent.render();
batch.draw(ent.sprite, ent.pos.x, ent.pos.y);
}
}
}
This is literaly all there is to it to render the map itself
public void render(Camera camera){
tiledMapRenderer.setView(camera);
tiledMapRenderer.render();
}
The reason I want to do it this way is to keep it simple, and to maintain the z-order of tiles,
where if the player walks under a bridge the bridge is displayed above the player.
Any and all help would be welcome… even if to just tell me I’m doing it wrong
Many Thanks.