Author Topic: Scrollview panels ignoring depth  (Read 2558 times)

Twolewis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Scrollview panels ignoring depth
« on: October 21, 2015, 11:31:27 AM »
Hi,

I upgraded to the latest version of NGUI (3.9.4), and looks like scrollviews are ignoring depths, and are rendered separately from other elements.  In the attached image, the depths of the elements are as  follows:


Widget - Scroll Container // 0
  + Sprite - BG // 1
  + Scroll View // 2
  + Grid
      + Sprite // 3
      + Sprite (1) // 3
Sprite // 100


From the attachment you can see that the scrollview elements draw over the Sprite at depth = 100.

Any help here is greatly appreciated --

Twolewis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Scrollview panels ignoring depth
« Reply #1 on: October 21, 2015, 12:13:31 PM »
OK, so I just learned that panels' depths behave separately from widgets inside of them.  So my next question, then, is how would I go about drawing widgets on top of a scrollview?  The specific context around this question is that I'd like to draw a messagebox (e.g. "the item you've selected is unavailable") on top of the scrollview whenever the player selected an item.  As it stands right now, the scrollview contents render on top of messagebox.  It seems to get around this, I need to make the messagebox into its own panel with a higher depth value.  Is there a better way to accomplish this than to make a separate panel just in order to draw on top of a scrollview?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scrollview panels ignoring depth
« Reply #2 on: October 24, 2015, 04:32:14 AM »
Add another panel with a depth higher than that of your scroll view's panel. Anything popup-related should be using a separate top-level panel anyway.