EditorGUILayout.PrefixLabel Manual     Reference     Scripting  
Scripting > Editor Classes > EditorGUILayout
EditorGUILayout.PrefixLabel

static function PrefixLabel (label : string, followingStyle : GUIStyle = "Button") : void

static function PrefixLabel (label : string, followingStyle : GUIStyle, labelStyle : GUIStyle) : void

static function PrefixLabel (label : GUIContent, followingStyle : GUIStyle = "Button") : void

static function PrefixLabel (label : GUIContent, followingStyle : GUIStyle, labelStyle : GUIStyle) : void

Parameters

NameDescription
label Label to show in front of the control.

Description

Make a label in front of some control.


Simple window that shows the prefix label.

class SimplePrefixLabelUsage extends EditorWindow {

@MenuItem("Examples/PrefixLabel Usage")
static function Init() {
var window = GetWindow(SimplePrefixLabelUsage);
window.Show();
}

function OnGUI() {
var ammo : int = 0;
EditorGUILayout.BeginHorizontal();
EditorGUILayout.PrefixLabel("Ammo");
target = EditorGUILayout.IntField(ammo);
EditorGUILayout.EndHorizontal();
}
}