言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

GUILayout.Space

public static function Space(pixels: float): void;

Description

現在のレイアウトグループにスペースを挿入します

スベースの方向はコマンドを実行するときのレイアウトグループに依存しています。レイアウトグループが垂直グループの場合はスペースは垂直に挿入されます: 注意: これは GUILayout.ExpandWidthGUILayout.ExpandHeight によってオーバーライドされます。
2つのボタンの間に20pxのスペース

	function OnGUI () {
		GUILayout.Button ("I'm the first button");

		// Insert 20 pixels of space between the 2 buttons.
		GUILayout.Space (20);
			
		GUILayout.Button ("I'm a bit further down");
	}

水平グループでは pixels は水平として測定されます:

	function OnGUI () {
		GUILayout.BeginHorizontal();
			GUILayout.Button ("I'm the first button");

			// Insert 20 pixels of space between the 2 buttons.
			GUILayout.Space (20);
			
			GUILayout.Button ("I'm the second button");
		GUILayout.EndHorizontal();
	}