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?

2 Answers

2

Check these out: GUILayout.Width and GUILayout.Height. I’m not very familiar with the GUILayout class, but I think those should work.

GUILayout.Box("box", GUILayout.Width(100), GUILayout.Height(25));