Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

EditorGUI.LabelField

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual
public static function LabelField(position: Rect, label: string, style: GUIStyle = EditorStyles.label): void;
public static void LabelField(Rect position, string label, GUIStyle style = EditorStyles.label);
public static function LabelField(position: Rect, label: GUIContent, style: GUIStyle = EditorStyles.label): void;
public static void LabelField(Rect position, GUIContent label, GUIStyle style = EditorStyles.label);
public static function LabelField(position: Rect, label: string, label2: string, style: GUIStyle = EditorStyles.label): void;
public static void LabelField(Rect position, string label, string label2, GUIStyle style = EditorStyles.label);
public static function LabelField(position: Rect, label: GUIContent, label2: GUIContent, style: GUIStyle = EditorStyles.label): void;
public static void LabelField(Rect position, GUIContent label, GUIContent label2, GUIStyle style = EditorStyles.label);
public static function LabelField(position: Rect, label: string, style: GUIStyle = EditorStyles.label): void;
public static void LabelField(Rect position, string label, GUIStyle style = EditorStyles.label);
public static function LabelField(position: Rect, label: GUIContent, style: GUIStyle = EditorStyles.label): void;
public static void LabelField(Rect position, GUIContent label, GUIStyle style = EditorStyles.label);
public static function LabelField(position: Rect, label: string, label2: string, style: GUIStyle = EditorStyles.label): void;
public static void LabelField(Rect position, string label, string label2, GUIStyle style = EditorStyles.label);
public static function LabelField(position: Rect, label: GUIContent, label2: GUIContent, style: GUIStyle = EditorStyles.label): void;
public static void LabelField(Rect position, GUIContent label, GUIContent label2, GUIStyle style = EditorStyles.label);

Parámetros

position Rectangle on the screen to use for the label field.
label Label in front of the label field.
label2 The label to show to the right.
style Style information (color, etc) for displaying the label.

Descripción

Make a label field. (Useful for showing read-only info.)


Shows a label in an editor window with the seconds since the editor started.

	// Shows a label in the editor with the seconds since the editor started
	
	class EditorGUILabelField extends EditorWindow {	
		@MenuItem("Examples/EditorGUI Label Usage")
		static function Init() {
			var window = GetWindow(EditorGUILabelField);
			window.Show();
		}
		function OnGUI() {
			EditorGUI.LabelField(Rect(3,3,position.width, 20),
				"Time since start: ", 
				EditorApplication.timeSinceStartup.ToString());
			this.Repaint();
		}
	}