Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

GUI.Toolbar

マニュアルに切り替える
public static function Toolbar(position: Rect, selected: int, texts: string[]): int;
public static function Toolbar(position: Rect, selected: int, images: Texture[]): int;
public static function Toolbar(position: Rect, selected: int, content: GUIContent[]): int;
public static function Toolbar(position: Rect, selected: int, texts: string[], style: GUIStyle): int;
public static function Toolbar(position: Rect, selected: int, images: Texture[], style: GUIStyle): int;
public static function Toolbar(position: Rect, selected: int, contents: GUIContent[], style: GUIStyle): int;

パラメーター

position ツールバーを描画するスクリーン上の Rect
selected 選択したボタンのインデックスを返します
texts ツールバーボタン上に表示する文字列配列
images ツールバーボタン上に表示するテクスチャ配列
contents ツールバーボタンのテキスト、画像、ツールチップとなる GUIContent 配列
style 使用するスタイル。省略された場合は、現在の GUISkin にある button スタイルを使用します。

戻り値

int 選択したボタンのインデックスを返します

説明

ツールバー

	var toolbarInt : int = 0;
	var toolbarStrings : String[] = ["Toolbar1", "Toolbar2", "Toolbar3"];

function OnGUI () { toolbarInt = GUI.Toolbar (Rect (25, 25, 250, 30), toolbarInt, toolbarStrings); }