Author Topic: Multiple UIPanel in the same hierarchy  (Read 3608 times)

Altheon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Multiple UIPanel in the same hierarchy
« on: January 21, 2014, 10:23:20 PM »
I am just curious, is it okay to add another UIPanel on a child of another UIPanel ?

MenuWindow(UIPanel)
|
|
-----> CharacterAvatar(UIPanel)
          |
          |
          -----> FacePanel(UIPanel)

is there any effect to the drawcalls?

sorry noob question  ;D

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Multiple UIPanel in the same hierarchy
« Reply #1 on: January 22, 2014, 02:03:03 AM »
Each level results in a new set of draw calls, but sure, you can do that.

Altheon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Multiple UIPanel in the same hierarchy
« Reply #2 on: January 22, 2014, 05:27:05 AM »
Each level results in a new set of draw calls, but sure, you can do that.

Ah I see, all widgets depth depend on the UIPanel containing them not the hierarchy.

MenuWindow(UIPanel , depth : 0)
|
|
-----> CharacterAvatar(UIPanel, depth : 1)
          |
          |
          -----> Widget1(UIWidget , depth : 1)
          |
          |
          -----> FacePanel(UIPanel , depth : 2)
          |
          |
          -----> Widget2(UIWidget, depth : 3)

I tried this, Widget2 will be draw behind FacePanel even if the depth is higher and on the same hierarchy level.

It's clear now. Thank you very much  :D