- 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.BeginHorizontal 开始水平组
static function BeginHorizontal (params options : GUILayoutOption[]) : void
static function BeginHorizontal (style : GUIStyle, params options : GUILayoutOption[]) : void
static function BeginHorizontal (text : string, style : GUIStyle, params options : GUILayoutOption[]) : void
static function BeginHorizontal (image : Texture, style : GUIStyle, params options : GUILayoutOption[]) : void
static function BeginHorizontal (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 Horizontal control group.
开始一个水平控件的组。
All controls rendered inside this element will be placed horiztonally next to each other. The group must be closed with a call to EndHorizontal.
所有被渲染的控件,在这个组里一个接着一个被水平放置。该组必须调用EndHorizontal关闭。
Horizontal Layout. 水平布局
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnGUI() {
GUILayout.BeginHorizontal("box");
GUILayout.Button("I'm the first button");
GUILayout.Button("I'm to the right");
GUILayout.EndHorizontal();
}
}
function OnGUI () {
// Starts a horizontal group
//开始一个水平组
GUILayout.BeginHorizontal ("box");
GUILayout.Button ("I'm the first button");
GUILayout.Button ("I'm to the right");
GUILayout.EndHorizontal ();
}