Unity学习笔记(3) --- Unity的界面排版:初识GUILayout

FideliaZUBK 8年前

来自: http://blog.csdn.net//likendsl/article/details/50254827


GUILayout 界面布局

相关文档GUILayout


The GUILayout class is the interface for Unity gui with automatic layouting.

GUILayout类是用于GUI自动布局的接口。

Class Functions类函数

  • Make an auto-layout label.
    创建一个自动布局的标签。
  • Make an auto-layout box.
    创建一个自动布局的box。
  • Make a single press button. The user clicks them and something happens immediately.
    创建一个单次按钮。当用户点击按钮会立即发生一些事件。
  • Make a repeating button. The button returns true as long as the user holds down the mouse
    创建一个重复按钮。当用户点击按钮会立即发生一些事件。只要用户按住鼠标,按钮返回true。
  • Make a single-line text field where the user can edit a string.
    创建一个单行文本字段,用户可以编辑其中的字符串。
  • Make a text field where the user can enter a password.
    创建一个单行密码文本字段,用户可以输入密码。
  • Make a multi-line text field where the user can edit a string.
    创建一个多行密码文本区域,用户可以编辑其中字符串。
  • Make an on/off toggle button.
    创建一个开关按钮。
  • Make a toolbar
    创建一个工具栏。
  • Make a Selection Grid
    创建一个选择表格。
  • A horizontal slider the user can drag to change a value between a min and a max.
    创建一个水平滑动条,用户可以拖动改变在最小和最大值之间的值。
  • A vertical slider the user can drag to change a value between a min and a max.
    创建一个垂直滑动条,用户可以拖动改变在最小和最大值之间的值。
  • Make a hopriztonal scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scroll views instead.

  • 创建水平滚动条。滚动条是能通过滚动来浏览文档,大多数情况下,你可以使用scrollView代替。
  • Make a vertical scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead.

  • 创建垂直滚动条。滚动条是能通过滚动来浏览文档,大多数情况下,你可以使用scrollView代替。
  • Insert a space in the current layout group.
    在当前层组插入空白。
  • Insert a flexible space element.
    插入一个弹性空白元素。
  • Begin a Horizontal control group.
    开始一个水平控件的组。
  • Close a group started with BeginHorizontal
    关闭由BeginHorizontal开始的一个组。
  • Begin a vertical control group.
    开始一个垂直控件的组。
  • Close a group started with BeginVertical
    关闭由BeginVertical开始的一个组。
  • Begin a GUILayout block of GUI controls in a fixed screen area.
    在屏幕上开始一个固定大小的布局区域。
  • Close a GUILayout block started with BeginArea
    关闭由BeginArea开始GUILayout布局块。
  • Begin an automatically laid out scrollview.
    开始一个自动布局滚动视图。
  • End a scroll view begun with a call to BeginScrollView.
    结束一个由BeginScrollView开始的滚动视图。
  • Make a popup window that layouts its contents automatically.
    创建一个弹出窗口,它的内容是自动布局的。
  • Option passed to a control to give it an absolute width.
    传递给控件的选项,给它一个绝对的宽度。
  • Option passed to a control to specify a minimum width.
    传递给控件指定一个最小宽度的选项。
  • Option passed to a control to specify a maximum width.
    传递给控件指定一个最大宽度的选项。
  • Option passed to a control to give it an absolute height.
    传递给控件的选项,给它一个绝对的高度。
  • Option passed to a control to specify a minimum height.
    传递给控件指定一个最小高度的选项。
  • Option passed to a control to specify a maximum height.
    传递给控件指定一个最大高度的选项。
  • Option passed to a control to allow or disallow horizontal expansion.
    传递给控件是否允许水平液态方向的选项。
  • Option passed to a control to allow or disallow vertical expansion.
    传递给控件是否允许垂直液态方向的选项。

    </div> </li> </ul>