Author Topic: UIPanel depth behavior is frustrating.  (Read 2673 times)

Dennis_N

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
UIPanel depth behavior is frustrating.
« on: February 07, 2014, 10:02:16 AM »
UIpanel doesn't play nice when it comes to depth settings. If set in front of a stack of sprites, it will ignore their individual depth settings and go in front or behind the sprite with the lowest depth setting.
So there is no way to sandwich a UI panel between sprites. This is very frustrating to me.
I want to use a transparent border that clips differently than the straight line of the rectangle clipping option. But that's not possible.
How can I get this to work?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPanel depth behavior is frustrating.
« Reply #1 on: February 08, 2014, 02:44:53 PM »
Panel depth is different from sprite depth.

Panel depth supersedes folder depth. Think of panels as file folders. You may sort files within a folder by their name (depth), but you can't expect files from different folders (panels) to mix.

If you are having trouble with this, then stick to only one panel. I'm not quite clear on the last thing you said. Transparent border that clips differently than the straight line of rectangle clipping option...?

Dennis_N

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: UIPanel depth behavior is frustrating.
« Reply #2 on: February 11, 2014, 08:18:48 AM »
I'm trying to achieve what the rectangular clipping does, but with a transparent sprite border put in front of the grid that gets scrolled.
Its not possible to do that. No matter what I do, and whatever parent I choose for the border, it always hides behind the scroll items.
And since UIPanel is needed for UIScroll, I cannot disable it either.
So is there any way I can make the scroll items hide behind something else instead of getting clipped?

ryan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 90
    • View Profile
Re: UIPanel depth behavior is frustrating.
« Reply #3 on: February 11, 2014, 01:27:45 PM »
If you want something to draw on top of the scroll view, you need another panel with a higher depth.  So you'll have three panels: one for whatever draws behind the scroll view, one for the scroll view, and one for stuff in front of the scroll view.

Dennis_N

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: UIPanel depth behavior is frustrating.
« Reply #4 on: February 11, 2014, 02:14:46 PM »
If you want something to draw on top of the scroll view, you need another panel with a higher depth.  So you'll have three panels: one for whatever draws behind the scroll view, one for the scroll view, and one for stuff in front of the scroll view.

Thanks a bunch! That worked. I'm surprised that is the only thing I didn't try.