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.EndGroup 结束组
static function EndGroup () : void
Description描述
End a group.
Should be attached with GUI.BeginGroup
结束组,和开数组BeginGroup成对使用。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnGUI() {
GUI.BeginGroup(new Rect(Screen.width / 2 - 400, Screen.height / 2 - 300, 800, 600));
GUI.Box(new Rect(0, 0, 800, 600), "This box is now centered! - here you would put your main menu");
GUI.EndGroup();
}
}
function OnGUI () {
//在屏幕上把GUI控件约束在800x600像素居中的区域内。
GUI.BeginGroup(new Rect(Screen.width / 2 - 400, Screen.height / 2 - 300, 800, 600));
//Boxd的坐标将相对于组的左上角0,0
GUI.Box(new Rect(0,0,800,600), "This box is now centered! - here you would put your main menu");
//有开始组,不要忘记要结束组。
GUI.EndGroup();
}
最后修改:2011年1月14日 Friday 22:05