Author Topic: Bug: Label hides behind sprite with explicit Render Q  (Read 2629 times)

ishti10

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Bug: Label hides behind sprite with explicit Render Q
« on: February 17, 2014, 04:09:29 AM »
Create a panel
Create a child white box sprite
Create a child label with colored text
Set panels Render Q to explicit
Label can not be seen anymore
Depth order of children widgets doesn't seem to matter
I believe it is a bug

Only workaround is to put a panel on label and set explicit render Q to +1. This is not a good workaround.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bug: Label hides behind sprite with explicit Render Q
« Reply #1 on: February 17, 2014, 11:47:46 AM »
This is how Explicit render queue works. When you set it to explicit, all draw calls generated by the panel will have their render queue explicitly set to the value of your choice.

This mimics the behaviour of NGUI 2 where you had to adjust transform's Z position in order to determine what's in front of what.

coeing

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 11
    • View Profile
    • slash games
Re: Bug: Label hides behind sprite with explicit Render Q
« Reply #2 on: May 05, 2014, 11:06:52 AM »
I use the "Explicit" Render Q setting to set the sorting order as this field doesn't show up in the other settings. I need to set the sorting order to do the sorting between NGUI and some other addons we use (e.g. Spine, mesh texts,...).

As reported the labels are rendered behind my sprites then. As a workaround I set the sorting order while having "Explicit" selected and than switch back to "StartAt" or "Automatic". This way I get the correct sorting order and render queue as well.

So my question: Why is the sorting order field hidden in the other render queue settings except "Explicit"? What was the reason for this decision?
Visit slash games at http://www.slashgames.org

Indie Game Developer from Hamburg, Germany.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bug: Label hides behind sprite with explicit Render Q
« Reply #3 on: May 05, 2014, 11:32:38 PM »
I'll just expose it in the next update so you won't need to use the work-around anymore. You can do the same thing locally by commenting out line 554 of UIPanelInspector.cs.

coeing

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 11
    • View Profile
    • slash games
Re: Bug: Label hides behind sprite with explicit Render Q
« Reply #4 on: May 12, 2014, 12:08:36 PM »
Great, thanks!
Visit slash games at http://www.slashgames.org

Indie Game Developer from Hamburg, Germany.