- BeginArea
- BeginHorizontal
- BeginScrollView
- BeginVertical
- Box
- Button
- EndArea
- EndHorizontal
- EndScrollView
- EndVertical
- ExpandHeight
- ExpandWidth
- FlexibleSpace
- Height
- HorizontalScrollbar
- HorizontalSlider
- Label
- MaxHeight
- MaxWidth
- MinHeight
- MinWidth
- PasswordField
- RepeatButton
- SelectionGrid
- Space
- TextArea
- TextField
- Toggle
- Toolbar
- VerticalScrollbar
- VerticalSlider
- Width
- Window
GUILayout.BeginVertical 开始垂直组
static function BeginVertical (params options : GUILayoutOption[]) : void
static function BeginVertical (style : GUIStyle, params options : GUILayoutOption[]) : void
static function BeginVertical (text : string, style : GUIStyle, params options : GUILayoutOption[]) : void
static function BeginVertical (image : Texture, style : GUIStyle, params options : GUILayoutOption[]) : void
static function BeginVertical (content : GUIContent, style : GUIStyle, params options : GUILayoutOption[]) : void
Parameters参数
-
textText to display on group
显示在组上的文本 -
imageTexture to display on group
显示在组上的纹理 -
contentText, image and tooltip for this group .
用于该组的文本、图片和工具提示 -
styleThe style to use for background image and padding values. If left out, the background is transparent.
该样式用于背景图片和内边距值。如果不设置,背景是透明的。 -
optionsAn optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.
布局选项指定额外布局属性的一个可选列表。这里传递任意值都将覆盖由style定义的设置。
参考: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight
Description描述
Begin a vertical control group.
开始一个垂直控件的组。
All controls rendered inside this element will be placed vertically below each other. The group must be closed with a call to EndVertical.
所有被渲染的控件,在这个组里一个接着一个被垂直放置。该组必须调用EndVertical关闭。
Vertical Layout. 垂直布局
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnGUI() {
GUILayout.BeginVertical("box");
GUILayout.Button("I'm the top button");
GUILayout.Button("I'm the bottom button");
GUILayout.EndVertical();
}
}
function OnGUI () {
// Starts a vertical group
//开始一个垂直组
GUILayout.BeginVertical ("box");
GUILayout.Button ("I'm the top button");
GUILayout.Button ("I'm the bottom button");
GUILayout.EndVertical();
}