GUI
- backgroundColor
- BeginGroup
- BeginScrollView
- Box
- BringWindowToBack
- BringWindowToFront
- Button
- changed
- color
- contentColor
- depth
- DragWindow
- DrawTexture
- enabled
- EndGroup
- EndScrollView
- FocusControl
- FocusWindow
- GetNameOfFocusedControl
- GUI
- HorizontalScrollbar
- HorizontalSlider
- Label
- matrix
- PasswordField
- RepeatButton
- ScrollTo
- SelectionGrid
- SetNextControlName
- skin
- TextArea
- TextField
- Toggle
- Toolbar
- tooltip
- UnfocusWindow
- VerticalScrollbar
- VerticalSlider
- Window
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参数
- positionRectangle on the screen to use for the toolbar.
用于工具栏在屏幕上的矩形位置。 - selectedThe index of the selected button
被选择按钮的索引号。 - textsAn array of strings to show on the toolbar buttons.
显示在工具栏按钮上的字符串数组
- imagesAn array of textures on the toolbar buttons.
在工具栏按钮上的图片纹理数组 - contentsAn array of text, image and tooltips for the toolbar buttons.
用户工具栏按钮的文本,图片和提示信息数组。 - styleThe style to use. If left out, the button style from the current GUISkin is used.
使用样式,如果不使用,按钮的样式应用当前的GUISkin皮肤。
int - The index of the selected button.
返回int类型,被选择按钮的索引号。
Description描述
Make a toolbar
创建工具栏。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public int toolbarInt = 0;
public string[] toolbarStrings = new string[] {"Toolbar1", "Toolbar2", "Toolbar3"};
void OnGUI() {
toolbarInt = GUI.Toolbar(new Rect(25, 25, 250, 30), toolbarInt, toolbarStrings);
}
}
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