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.Box绘制纹理
static function Box (position : Rect, text : string) : void
static function Box (position : Rect, image : Texture) : void
static function Box (position : Rect, content : GUIContent) : void
static function Box (position : Rect, text : string, style : GUIStyle) : void
static function Box (position : Rect, image : Texture, style : GUIStyle) : void
static function Box (position : Rect, content : GUIContent, style : GUIStyle) : void
Parameters参数
-
positionRectangle on the screen to use for the box.
用于盒子在屏幕上的矩形位置。 -
textText to display on the box.
在盒子上显示的文本 -
imageTexture to display on the box.
显示在盒子上的纹理图片 -
contentText, image and tooltip for this box.
用户盒子的文本,图片和提示信息 -
styleThe style to use. If left out, the box style from the current GUISkin is used.
使用的样式,如果不,盒子使用当前的GUISkin皮肤。
Description描述
Make a graphical box.
创建一个图形盒子。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnGUI() {
GUI.Box(new Rect(0, 0, Screen.width, Screen.height), "This is a title");
}
}
//创建一个屏幕大小的盒子
function OnGUI() {
GUI.Box(Rect(0,0,Screen.width,Screen.height),"This is a title");
}
最后修改:2011年1月14日 Friday 22:02