Global Z ordering
master312 last edited by master312
Is it possible to handle Z priority on global/scene level ?
I need to have actor that is linked to parent, and render another non-linked actor between them.
(Desired results in green picture... Anime character is linked to red square, while cog is not linked to anything)
When I set red actor to z priority to 0, anime actor to 100 and cog to 50 I get something like this.
If this is not possible, i'll implement this feature my self. Any suggestions on where to start would be appreciated Thanks in advance.
Hello, there is no global Z ordering between all sprites on scene.
Maybe Actor::setPriority will help you. It is local z ordering for actor's children.
so if you will work on own global Z ordering
here is some tips for you:
it is protected method which give you access to 'flags' where you could store your own 'z-order' flag without custom inheritance from each actor/sprite
override virtual Actor::render and collect all actors to vector<> with priorities. sort then draw this list
you will need to save RenderState/Transform too for each Actor to correct rendering
master312 last edited by
Thanks for fast response and tips
I try implementing my own ordering system.