Hi,
Struggling to find a way to center elements horizontaly within a vertical section.
Either I missed a very obvious set up or else it needs some rect computation, but can not find anything that sparks a solution in my head for this just yet.
GUILayout.BeginVertical();
GUILayout.Button("Click here",GUILayout.Width(100));
GUILayout.EndVertical();
Thanks for your help,
Jean
You could abuse a horizontal section for it with flexible space either side:
GUILayout.BeginVertical();
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
GUILayout.Button("Click here",GUILayout.Width(100));
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
GUILayout.EndVertical();
The only problem is that you'd have to have the horizontal section for each item inside the vertical block