Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: nah0y on December 17, 2013, 05:17:00 AM
-
Hello,
Small question, what do you recommend doing as a hierarchy for a window for example.
We can do multiple things such as :
1) Empty GameObject
- MyWindow (empty)
-- Background (sprite)
-- ScrollView
-- etc...
2) What you do in your videos
- MyWindow (the background sprite)
-- ScrollView
-- etc...
It seems that the second approach as the advantage with anchors, cause if I set an anchor on the scrollview, it will automatically be based on the background, which is not true for the first one.
But it seems weird to have a parent that is a background sprite... no ?
-
Also a disadvantage for the second method, it's if you want to change the alpha of the sprite, it will change also change the alpha of children :/
-
That can be a big advantage as well, depending on what you need to achieve with certain UIs/UI elements.
There's no one 'best' solution for every case you come across. In our projects, we mix and match as necessary, and this is fine because everybody understands when we need to lay out our hierarchies in a particular way - they're not caught out by it. It's not something I'd recommend if people are less aware of what's going on with your UI, however.
-
Yeah I think we should do per-problem, but I wanted to know if we can have a consistent solution across the project. I have my answer now :)
-
It's always tempting to have a general solution, but it's almost never the case. Unfortunately, life is too complicated for that. :)
-
Ahah :)