- Home /
How to specify height and width in my GUILayout.Box?
I am having a button where in if I click it opens up a GUI Box.. Here it takes the whole screen but I want that to restrict that to some specific dimensions. How will I do that?
How will I specify the screen width and height?
Is there any better way to do this?
Answer by Kleptomaniac · Mar 10, 2012 at 02:56 PM
Check these out: GUILayout.Width and GUILayout.Height. I'm not very familiar with the GUILayout
class, but I think those should work.
Answer by vl_nikolaev · Jan 14, 2014 at 11:30 AM
GUILayout.Box("box", GUILayout.Width(100), GUILayout.Height(25));
Your answer
![](https://koobas.hobune.stream/wayback/20220613064944im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Aligning an overlay to existing GUI elements 0 Answers
Open gui if player clicks on button 2 Answers
Help w/GUILayout Please 1 Answer
GUIlayout scrollbar, Not working well... 1 Answer
Make GUILayout horizontal first, then vertical? (C#) 3 Answers