There is no silver bullet for something highly custom like that.
Your best bet is to simply position the widgets yourself based on your own logic in a custom script written just for that purpose.
Sure! Any way i've bought latest NGUI and pretty happy with it.
But what about
NGUIMath.Calculate.. which returns Bounds.size?
Now i'm thinking of this scene structure:
- Container1 (widget) (this is main window)
--- Container2 Game Object (Anchor to Container1 TopLeft corner)
------ Title (UILabel) (Anchor to Container2 left to center it vertically)
------ Description (UILabel) (Anchor to Title)
------ Icon (Sprite) (Anchor to Title)
------ Other content elems..
--- Background (Sprite) (Anchor to Container1 left top right bottom)
I'm trying to get Container2 dimensions by:
Bounds bounds = NGUIMath.CalculateRelativeWidgetBounds(transform, transform.FindChild("Container2").transform);
Then i just resize the Container1 by:
GetComponent<UIWidget>().width = bounds.size.x + myCustomPadding;
GetComponent<UIWidget>().height = bounds.size.y + myCustomPadding;
Am i on a right route or there is some gotchas?
For example old UIAnchor will not update automatically to center content. How can i trigger this recalculation from outside? I have RunOnlyOnce checkbox checked.