- Home /
Unity GUI : splitting vertical layout group by ratio
In the picture above, I would like to fix the ratio of 'a' and 'b. 'A' is a 2, 'b' is definitively 1. What should I do?
Answer by $$anonymous$$ · May 23, 2016 at 07:56 PM
In the vertical layout group you should disable ChildForceExpand Height. In each child of the layout group you add a component called LayoutElement. Activate the boolean FlexibleHeight and give it a value of 50 for the first child and give it a value of 100 in the second child (or any other ratio that gives 1:2).
50 is really small on a high resolution screen, and big on a low resolution screen. It would be nice if there was an actual ratio. I guess you could get the ratio from the screen height and width in pixels and calculate your own. I guess that is how you have to work in unity ui to account for dynamic screen sizes because they don't have tools for that.
Your answer

Follow this Question
Related Questions
GUI Layout problem 1 Answer
know GUILayout current screen position 2 Answers
Is there any way to make gui faster and effective 0 Answers
Editor GUI Like mesh import animation inspector 0 Answers
How do I scale a Toggle button 0 Answers