GUILayout
.ExpandWidth
Manual
Reference
Scripting
Scripting
>
Runtime Classes
>
GUILayout
GUILayout
.ExpandWidth
Menu
Overview
Runtime Classes
Attributes
Enumerations
Editor Classes
Enumerations
History
Index
GUILayout
All Members
Class Functions
BeginArea
BeginHorizontal
BeginScrollView
BeginVertical
Box
Button
EndArea
EndHorizontal
EndScrollView
EndVertical
ExpandHeight
ExpandWidth
FlexibleSpace
Height
HorizontalScrollbar
HorizontalSlider
Label
MaxHeight
MaxWidth
MinHeight
MinWidth
PasswordField
RepeatButton
SelectionGrid
Space
TextArea
TextField
Toggle
Toolbar
VerticalScrollbar
VerticalSlider
Width
Window
static
function
ExpandWidth (expand :
bool
) :
GUILayoutOption
Description
Option passed to a control to allow or disallow horizontal expansion.
JavaScripts
JavaScript
C#
Boo
function
OnGUI
() {
GUILayout.BeginVertical
();
GUILayout.Button
(
"Short Button"
,
GUILayout.ExpandWidth
(
false
));
GUILayout.Button
(
"Very very long Button"
);
GUILayout.EndVertical
();
}
using UnityEngine;
using System.Collections;
public
class
example :
MonoBehaviour
{
void
OnGUI
() {
GUILayout.BeginVertical
();
GUILayout.Button
(
"Short Button"
,
GUILayout.ExpandWidth
(
false
));
GUILayout.Button
(
"Very very long Button"
);
GUILayout.EndVertical
();
}
}
import
UnityEngine
import
System.Collections
class
example(
MonoBehaviour
):
def
OnGUI
():
GUILayout.BeginVertical
()
GUILayout.Button
('Short Button',
GUILayout.ExpandWidth
(
false
))
GUILayout.Button
('Very very long Button')
GUILayout.EndVertical
()