EditorGUI.LabelField 标签字段

static function LabelField (position : Rect, label : string, label2 : string) : void

Parameters参数

Description描述

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

制作一个标签字段。(通常用于显示只读信息)

EditorGUI.LabelField 标签字段

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();

	}

}
Page last updated: 2011-6-22