GUILayout
.Width
Manual
Reference
Scripting
Scripting
>
Runtime Classes
>
GUILayout
GUILayout
.Width
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
Width (width :
float
) :
GUILayoutOption
Description
Option passed to a control to give it an absolute width.
Fixed width for a GUI Control.
JavaScripts
JavaScript
C#
Boo
// Draws a button with a fixed width
function
OnGUI
() {
GUILayout.Button
(
"A Button with fixed width"
,
GUILayout.Width
(300));
}
using UnityEngine;
using System.Collections;
public
class
example :
MonoBehaviour
{
void
OnGUI
() {
GUILayout.Button
(
"A Button with fixed width"
,
GUILayout.Width
(300));
}
}
import
UnityEngine
import
System.Collections
class
example(
MonoBehaviour
):
def
OnGUI
():
GUILayout.Button
('A Button
with
fixed width',
GUILayout.Width
(300))