GUILayout 类是 Unity GUI 的接口,并且具有自动布局功能。
另请参阅:GUI Layout tutorial。
BeginArea | 在一个固定的屏幕区域中开始 GUI 控件的 GUILayout 块。 |
BeginHorizontal | 开始一个水平控件组。 |
BeginScrollView | 开始一个自动布局的滚动视图。 |
BeginVertical | 开始一个垂直控件组。 |
Box | 创建一个自动布局框。 |
Button | 创建一个单击按钮。 |
EndArea | 闭合以 BeginArea 开始的 GUILayout 块。 |
EndHorizontal | 闭合以 BeginHorizontal 开始的组。 |
EndScrollView | 结束通过 BeginScrollView 调用开始的滚动视图。 |
EndVertical | 闭合以 BeginVertical 开始的组。 |
ExpandHeight | 传递给控件以允许或禁止垂直扩展的选项。 |
ExpandWidth | 传递给控件以允许或禁止水平扩展的选项。 |
FlexibleSpace | 插入灵活的空白元素。 |
Height | 传递给控件以使其具有绝对高度的选项。 |
HorizontalScrollbar | 创建一个水平滚动条。 |
HorizontalSlider | 用户可以拖动的水平滑动条,用于在最小值和最大值之间更改某值。 |
Label | 创建一个自动布局标签。 |
MaxHeight | 传递给控件以指定最大高度的选项。 |
MaxWidth | 传递给控件以指定最大宽度的选项。 |
MinHeight | 传递给控件以指定最小高度的选项。 |
MinWidth | 传递给控件以指定最小宽度的选项。 |
PasswordField | 创建一个可让用户输入密码的文本字段。 |
RepeatButton | 创建一个重复按钮。只要用户按住鼠标,该按钮就返回 true。 |
SelectionGrid | 创建一个选择网格。 |
Space | 在当前布局组中插入空白元素。 |
TextArea | 创建一个可供用户编辑字符串的多行文本字段。 |
TextField | 创建一个可供用户编辑字符串的单行文本字段。 |
Toggle | 创建一个打开/关闭的开关按钮。 |
Toolbar | 创建一个工具栏。 |
VerticalScrollbar | 创建一个垂直滚动条。 |
VerticalSlider | 用户可以拖动的垂直滑动条,用于在最小值和最大值之间更改某值。 |
Width | 传递给控件以使其具有绝对宽度的选项。 |
Window | 创建一个对自身内容进行自动布局的弹出窗口。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.