Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Altheon on January 21, 2014, 10:23:20 PM

Title: Multiple UIPanel in the same hierarchy
Post by: Altheon 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
Title: Re: Multiple UIPanel in the same hierarchy
Post by: ArenMook on January 22, 2014, 02:03:03 AM
Each level results in a new set of draw calls, but sure, you can do that.
Title: Re: Multiple UIPanel in the same hierarchy
Post by: Altheon 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