- Home /
Question by
absameen · May 12, 2012 at 06:45 PM ·
centerverticalhorizontal
Center GUIContent Vertically
Let's say you have a GUILayout.BeginHorizontal() and GUILayout.EndHorizontal(). You want to vertically center all of the content in that horizontal. How can this be achieved?
Comment
Best Answer
Answer by Berenger · May 12, 2012 at 07:11 PM
GUILayout.BeginHorizontal();
GUILayout.BeginVertical();
GUILayout.FlexibleSpace();
GUI.Something
GUILayout.FlexibleSpace();
GUILayout.EndVertical();
GUILayout.EndHorizontal();
Or through the variable alignement of the style.
You're my hero. I wanted to align 2 elements horizontally and GUILayout.FlexibleSpace()
helped!
Your answer
Follow this Question
Related Questions
Get walk animation to play on horizontal and vertical axis presses. 2 Answers
How can I play different animations depending on the direction my character is moving? 1 Answer
What is the value of joystick code vertical and horizontal 0 Answers
alternative to using horizontal/vertical 1 Answer
How to detect Double Clicking Horizontal/Vertical Axis on joystick 0 Answers