Hey there,
I’m trying to create a UI which I’d optimally want to be loadable from XML completely, then just get UI children by name in code to attach them to events.
I’m missing some layouting feature. I know that layouts can be set to be horizontal, vertical or free.
When free, children require a specified size which they’ll then have fixed.
When horizontal or vertical, all children divide up the total space of the parent amongst themselves so that each is of approx. equivalent size.
I need an option which only requires parents to become as big as their children require it. For example, a button should only be as large as it’s Text content (and padding).
Can this only be done in code? I found a piece of code doing something similar in the Editor script (when it resizes the menu buttons), but it didn’t work for me - the Text content was reported to be 0 size, so I couldn’t scale the parent according to it.
Also, how do I find out the possible attribute name
strings in XML files?