Hi! I’m coming back after integrating a significant subset of Tiled into my game engine, having myself a bit confused about the rendering order of objects within an ObjectGroup.
As far as I know, an ObjectGroup has a “draworder” property which is one of “topdown” (default) and “index” (which allows you to order overlapping objects with “Page up”/“Page down”). When rendering a Tiled map, I would like to provide a predictable behaviour and render the same thing as Tiled would. However, when having the default “topdown” set, if two objects have the same “y” coordinate, I can’t seem to figure out what is the criteria to break ties? Which one will be drawn first? The one with smaller “x”? If they have the same “x” and “y”, then what is the criteria? The one which was added first (with the smallest “id”)? Is the behaviour in this case undefined? (that would actually give my engine more flexibility in deciding how to render those objects, while still being compatible with Tiled).
After playing a while with Tiled, I still couldn’t figure out what is the criteria.
Thanks in advance!