GUI 类是 Unity GUI 的接口,并且具有手动定位功能。
另请参阅:GUI 教程。
backgroundColor | 用于 GUI 渲染的所有背景元素的全局着色颜色。 |
changed | 如果任何控件更改了输入数据的值,则返回 true。 |
color | Applies a global tint to the GUI. The tint affects backgrounds and text colors. |
contentColor | 为 GUI 渲染的所有文本着色。 |
depth | 当前正在执行的 GUI 行为的排序深度。 |
enabled | 是否启用了 GUI? |
matrix | GUI 变换矩阵。 |
skin | 要使用的全局皮肤。 |
tooltip | 鼠标指针当前悬停在其上或具有键盘焦点的控件的工具提示。(只读) |
BeginGroup | 开始一个组。必须与 EndGroup 调用配对使用。 |
BeginScrollView | 在 GUI 内开始一个滚动视图。 |
Box | 在 GUI 层上创建一个框。 |
BringWindowToBack | 将特定窗口放置到该浮动窗口的后方。 |
BringWindowToFront | 将特定窗口放置到该浮动窗口的前方。 |
Button | 创建一个单击按钮。当用户点击该按钮时,立即执行一些操作。 |
DragWindow | 使窗口可被拖动。 |
DrawTexture | 在一个矩形内绘制纹理。 |
DrawTextureWithTexCoords | 使用给定的纹理坐标在矩形内绘制纹理。 |
EndGroup | 结束组。 |
EndScrollView | 结束使用 BeginScrollView 调用开始的滚动视图。 |
FocusControl | 将键盘焦点移动到某个命名控件。 |
FocusWindow | 使某个窗口成为激活窗口。 |
GetNameOfFocusedControl | 获取具有焦点的命名控件的名称。 |
HorizontalScrollbar | 创建一个水平滚动条。滚动条是用于滚动文档的控件。大多数情况下,您需要的可能是滚动视图。 |
HorizontalSlider | 用户可以拖动的水平滑动条,用于在最小值和最大值之间更改某值。 |
Label | 在屏幕上创建一个文本或纹理标签。 |
ModalWindow | 显示一个模态窗口。 |
PasswordField | 创建一个可让用户输入密码的文本字段。 |
RepeatButton | 创建一个只要用户按住就一直处于激活状态的按钮。 |
ScrollTo | 滚动包含的所有滚动视图,让它们尝试使 position 可见。 |
SelectionGrid | 创建一个按钮网格。 |
SetNextControlName | 设置下一个控件的名称。 |
TextArea | 创建一个可供用户编辑字符串的多行文本区域。 |
TextField | 创建一个可供用户编辑字符串的单行文本字段。 |
Toggle | 创建一个打开/关闭的开关按钮。 |
Toolbar | 创建一个工具栏。 |
UnfocusWindow | 从所有窗口移除焦点。 |
VerticalScrollbar | 创建一个垂直滚动条。滚动条是用于滚动文档的控件。大多数情况下,您需要的可能是滚动视图。 |
VerticalSlider | 用户可以拖动的垂直滑动条,用于在最小值和最大值之间更改某值。 |
Window | 创建一个弹出窗口。 |
WindowFunction | 在窗口中绘制 GUI 的回调(与 GUI.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.