Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: duncanx on June 26, 2013, 03:13:10 AM

Title: To use Panel or Empty Gameobject?
Post by: duncanx on June 26, 2013, 03:13:10 AM
When you use clipping on a panel, everything attached to that panel gets clipped...but you'll usually want to have a background of some sort...probably a tiledsprite. For example if we are making a floating window that has some scrollable elements in it. My question, for that background (or stuff that we don't want to get clipped) is it best to use another UIPanel or just attach the tiledsprite to an empty gameobject?

In the unity hierarchy we get something like...

Option A

Option B

Which case should I use?
Title: Re: To use Panel or Empty Gameobject?
Post by: dlewis on June 26, 2013, 05:29:25 AM
Everything needs to be under a UIPanel so make one for the background (sans clipping)
Title: Re: To use Panel or Empty Gameobject?
Post by: Nicki on June 26, 2013, 05:44:14 AM
If there's no UIPanel anywhere above a widget in the hierarchy, NGUI adds one by itself. It is smarter that you control it yourself and add one.
Title: Re: To use Panel or Empty Gameobject?
Post by: duncanx on June 26, 2013, 06:05:02 AM
Ah - that makes sense. Thanks!