1
NGUI 3 Support / Re: Laying out & inheritance - Pulling my hair out! X|
« on: September 24, 2012, 07:56:22 PM »
Thanks Aren.
I've had some success now. Here's the outcome...

For the record, here's the rules I followed when implementing:
- I never attached a UIStretch or a UIAnchor to a UIPanel.
- After creating each panel, the first thing I did was create a Widget (e.g. UISlicedSprite) that would define the physical bounds of that panel. I'd name this something like "0.Border.BOUNDS" to keep it at the top of the list and to remind me that this was the 'master' widget.
- Every time I created a UIAnchor or UIStretch on this panel, I would drag this BOUNDS object into the Widget Container field of that component. This logic cannot be applied to the Panel Container field because the Anchor/Stretch code ignores panels that have 'clipping' turned off.
For anyone that's interested, here's a childlike drawing of the hierarchy I used:

I did in fact stick with the UIOrthoCamera instead of using a UIRoot and it seems to work fine -- keeping the UI pixel perfect even with dynamic screen resizes (which is what I want).
I've now got about a hundred half-pixel and depth issues to fix, but I feel like I've broken the back of it thankfully =)
I've had some success now. Here's the outcome...
For the record, here's the rules I followed when implementing:
- I never attached a UIStretch or a UIAnchor to a UIPanel.
- After creating each panel, the first thing I did was create a Widget (e.g. UISlicedSprite) that would define the physical bounds of that panel. I'd name this something like "0.Border.BOUNDS" to keep it at the top of the list and to remind me that this was the 'master' widget.
- Every time I created a UIAnchor or UIStretch on this panel, I would drag this BOUNDS object into the Widget Container field of that component. This logic cannot be applied to the Panel Container field because the Anchor/Stretch code ignores panels that have 'clipping' turned off.
For anyone that's interested, here's a childlike drawing of the hierarchy I used:
I did in fact stick with the UIOrthoCamera instead of using a UIRoot and it seems to work fine -- keeping the UI pixel perfect even with dynamic screen resizes (which is what I want).
I've now got about a hundred half-pixel and depth issues to fix, but I feel like I've broken the back of it thankfully =)



