Author Topic: UIWidget depth effect  (Read 1635 times)

Tutanhomon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
UIWidget depth effect
« on: March 19, 2014, 06:31:47 AM »
Hi!
I have some sprites children to UIWidget. I expected that depth of this widget will have the same effect as UIPanel, but depth of UIWidget doesn't change anything.
To be more exact, I have an inventory with items, each one is a complex hierarchy of sprites and labels, all placed under UIWidget. When I start dragging one of inventory items, it's parts intersect with other's, cuz they have same depth. So before dragging I tried to increment depth of root UIWidget of graggable item, hoping that it will bring it front of other. But it had no effect. So, I had to place a UIPanel on top of each inventory item, and manipulate panel's depth.
So, is it bug or feature, this UIWidget's behaviour?
And what's the best way to solve such problems?
Thanks in advance.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIWidget depth effect
« Reply #1 on: March 20, 2014, 02:24:04 AM »
Panel depth supersedes widget depth (think: directory). For widget depth, think: files.

Neither are cumulative based on hierarchy.

If you want to bring selection to front, use the NGUI menu, right-click, or just the shortcut: ALT+SHIFT+= or ALT+SHIFT+-.

If you want to do it via code, NGUITools.AdjustDepth can do that for you.

Tutanhomon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 13
    • View Profile
Re: UIWidget depth effect
« Reply #2 on: March 20, 2014, 03:46:41 AM »
Great thanks Aren!