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

スクリプト言語

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

GUILayout.Box

public static function Box(content: GUIContent, style: GUIStyle, params options: GUILayoutOption[]): void;

Parameters

text ボックス上に表示するテキスト
image ボックス上に表示するTexture
content ボックスのテキスト、画像、ツールチップ
style 使用するスタイル。省略された場合は、現在のGUISkinにある box スタイルを使用します。
options 特別なレイアウト対応をするためのレイアウトオプションリスト。ここに渡された値は style で定義された設定を上書きします。
See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.

Description

自動レイアウトのボックスを作成します

これは静的なテキストや画像ではなく他のGUIコントロールを含むボックスを作成します。複数のGUIコントロールをセットした矩形のコンテナを作成するには、グールーイングを行う関数 (BeginHorizontalBeginVerticalBeginArea 等...) を使用します。
ゲームビューのボックス

	// Draws a texture and a label inside 2 different boxes
	var tex : Texture;

	function OnGUI() {
		if(!tex) {
			Debug.LogError("Missing texture, assign a texture in the inspector");
		}
		GUILayout.Box(tex);
		GUILayout.Box("This is an sized label");
	}