EditorGUILayout.BeginHorizontal 开始水平组

static function BeginHorizontal (params options : GUILayoutOption[]) : Rect
static function BeginHorizontal (style : GUIStyle, params options : GUILayoutOption[]) : Rect

Parameters参数

Description描述

Begin a horizontal group and get its rect back.

开始一个水平组并获取返回矩形。

This is an extension to GUILayout.BeginHorizontal. It can be used for making compound controls

这是GUILayout.BeginHorizontal的扩展。它可以用于制作混合控件。

EditorGUILayout.BeginHorizontal 开始水平组

Horizontal Compound group.
水平混合组

// Create a Horizontal Compound Button
//创建一个水平混合按钮 
class BeginEndHorizontalExample extends EditorWindow {

	@MenuItem("Examples/Begin-End Horizontal usage")
	static function Init() {
		var window = GetWindow(BeginEndHorizontalExample);
		window.Show();
	}

	function OnGUI() {
		var r : Rect = EditorGUILayout.BeginHorizontal ("Button");
		if (GUI.Button (r, GUIContent.none))
			Debug.Log ("Go here");
		GUILayout.Label ("I'm inside the button");
		GUILayout.Label ("So am I");
		EditorGUILayout.EndHorizontal ();
	}
}
Page last updated: 2011-7-14