Container boxes for GUI positioning

Hey,
I wanted to ask if there is a better way for GUI positioning, like Container boxes (like div boxes in html) for grouping elements. Or are there standard Layouts you can use in your script (like a gridLayout, FlowLayout in Java).

There are a lot of questions about GUI positioning in the Forum. I mostly use absolut sizes and sometimes I try to create a somehow responsive GUI by using Screen.height andn Screen.width but I think thats not enough for a good responsive GUI. If I’m not mistaken there isn’t even the possibility to set position and size with %.

I already read through tutorials and the basic stuff but I think there must be a few Unity professionals out there that have a better idea for how to design a goo User Interface

For containers, use GUILayout.BeginArea() if you’re using GUILayout, and GUI.BeginGroup() if you’re using GUI. Both change the origin of contained items to the upper left corner of the container.

The guys at Schell Games did a good presentation on scaleable GUIs at Unite 11. Unfortunately, the video is no longer online, but here are the slides:
http://unite.schellgames.com/Unite_2011_Scalable_Game_Development.pptx

1 Like

Thanks a lot. That is exactly what i was looking for :slight_smile:

Happy to help!

I would like to add that GUILayout.BeginArea, BeginVertical, Space and FlexibleSpace are very useful to organize the layout.