Global Z ordering

  • Hello 🙂

    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.

  • administrators

    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.

  • administrators

    so if you will work on own global Z ordering
    here is some tips for you:

    1. use Actor::_getFlags()
      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

    2. override virtual Actor::render and collect all actors to vector<> with priorities. sort then draw this list

    3. you will need to save RenderState/Transform too for each Actor to correct rendering

  • Thanks for fast response and tips 🙂
    I try implementing my own ordering system.

Log in to reply

Looks like your connection to Oxygine was lost, please wait while we try to reconnect.