GUI.Toolbar 工具栏

static function Toolbar (position : Rect, selected : int, texts : String[]) : int
static function Toolbar (position : Rect, selected : int, images : Texture[]) : int
static function Toolbar (position : Rect, selected : int, content : GUIContent[]) : int
static function Toolbar (position : Rect, selected : int, texts : String[], style : GUIStyle) : int
static function Toolbar (position : Rect, selected : int, images : Texture[], style : GUIStyle) : int
static function Toolbar (position : Rect, selected : int, contents : GUIContent[], style : GUIStyle) : int

Parameters参数

Returns

int - The index of the selected button.

返回int类型,被选择按钮的索引号。

Description描述

Make a toolbar

创建工具栏。

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

function OnGUI () {
	toolbarInt = GUI.Toolbar(Rect (25, 25, 250, 30), toolbarInt, toolbarStrings);
}
最后修改:2011年1月14日 Friday 21:47

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。