Unity学习笔记(4) --- Unity的界面排版:初识GUI
GUI和GUILayout是Unity提供的UIKit。在使用GUI的Controls时都要求设置Rect參数。没办法做到自己主动排版,给适配带来难度。而GUILayout的设计就是为了弥补这个缺陷,GUILayout是在GUI的基础之上复合了一套Layout的排版逻辑。
GUI
class in UnityEngine
Description
The GUI class is the interface for Unity's GUI with manual positioning.
See Also: GUI tutorial.
Static Variables
backgroundColor
Global tinting color for all background elements rendered by the GUI.
changed
Returns true if any controls changed the value of the input data.
color
Global tinting color for the GUI.
contentColor
Tinting color for all text rendered by the GUI.
depth
The sorting depth of the currently executing GUI behaviour.
enabled
Is the GUI enabled?
matrix
The GUI transform matrix.
skin
The global skin to use.
tooltip
The tooltip of the control the mouse is currently over, or which has keyboard focus. (Read Only).
Static Functions
BeginGroup
Begin a group. Must be matched with a call to EndGroup.
BeginScrollView
Begin a scrolling view inside your GUI.
Box
Make a graphical box.
BringWindowToBack
Bring a specific window to back of the floating windows.
BringWindowToFront
Bring a specific window to front of the floating windows.
Button
Make a single press button. The user clicks them and something happens immediately.
DragWindow
Make a window draggable.
DrawTexture
Draw a texture within a rectangle.
DrawTextureWithTexCoords
Draw a texture within a rectangle with the given texture coordinates. Use this function for clipping or tiling the image within the given rectangle.
EndGroup
End a group.
EndScrollView
Ends a scrollview started with a call to BeginScrollView.
FocusControl
Move keyboard focus to a named control.
FocusWindow
Make a window become the active window.
GetNameOfFocusedControl
Get the name of named control that has focus.
HorizontalScrollbar
Make a horizontal scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead.
HorizontalSlider
A horizontal slider the user can drag to change a value between a min and a max.
Label
Make a text or texture label on screen.
ModalWindow
Show a Modal Window.
PasswordField
Make a text field where the user can enter a password.
RepeatButton
Make a button that is active as long as the user holds it down.
ScrollTo
Scrolls all enclosing scrollviews so they try to make position visible.
SelectionGrid
Make a grid of buttons.
SetNextControlName
Set the name of the next control.
TextArea
Make a Multi-line text area where the user can edit a string.
TextField
Make a single-line text field where the user can edit a string.
Toggle
Make an on/off toggle button.
Toolbar
Make a toolbar.
UnfocusWindow
Remove focus from all windows.
VerticalScrollbar
Make a vertical scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead.
VerticalSlider
A vertical slider the user can drag to change a value between a min and a max.
Window
Make a popup window.
Delegates
WindowFunction
Callback to draw GUI within a window (used with GUI.Window).
GUI和GUILayout是Unity提供的UIKit。在使用GUI的Controls时都要求设置Rect參数。没办法做到自己主动排版,给适配带来难度。而GUILayout的设计就是为了弥补这个缺陷,GUILayout是在GUI的基础之上复合了一套Layout的排版逻辑。
GUI
class in UnityEngine
Description
The GUI class is the interface for Unity's GUI with manual positioning.
See Also: GUI tutorial.
Static Variables
| backgroundColor | Global tinting color for all background elements rendered by the GUI. |
| changed | Returns true if any controls changed the value of the input data. |
| color | Global tinting color for the GUI. |
| contentColor | Tinting color for all text rendered by the GUI. |
| depth | The sorting depth of the currently executing GUI behaviour. |
| enabled | Is the GUI enabled? |
| matrix | The GUI transform matrix. |
| skin | The global skin to use. |
| tooltip | The tooltip of the control the mouse is currently over, or which has keyboard focus. (Read Only). |
Static Functions
| BeginGroup | Begin a group. Must be matched with a call to EndGroup. |
| BeginScrollView | Begin a scrolling view inside your GUI. |
| Box | Make a graphical box. |
| BringWindowToBack | Bring a specific window to back of the floating windows. |
| BringWindowToFront | Bring a specific window to front of the floating windows. |
| Button | Make a single press button. The user clicks them and something happens immediately. |
| DragWindow | Make a window draggable. |
| DrawTexture | Draw a texture within a rectangle. |
| DrawTextureWithTexCoords | Draw a texture within a rectangle with the given texture coordinates. Use this function for clipping or tiling the image within the given rectangle. |
| EndGroup | End a group. |
| EndScrollView | Ends a scrollview started with a call to BeginScrollView. |
| FocusControl | Move keyboard focus to a named control. |
| FocusWindow | Make a window become the active window. |
| GetNameOfFocusedControl | Get the name of named control that has focus. |
| HorizontalScrollbar | Make a horizontal scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead. |
| HorizontalSlider | A horizontal slider the user can drag to change a value between a min and a max. |
| Label | Make a text or texture label on screen. |
| ModalWindow | Show a Modal Window. |
| PasswordField | Make a text field where the user can enter a password. |
| RepeatButton | Make a button that is active as long as the user holds it down. |
| ScrollTo | Scrolls all enclosing scrollviews so they try to make position visible. |
| SelectionGrid | Make a grid of buttons. |
| SetNextControlName | Set the name of the next control. |
| TextArea | Make a Multi-line text area where the user can edit a string. |
| TextField | Make a single-line text field where the user can edit a string. |
| Toggle | Make an on/off toggle button. |
| Toolbar | Make a toolbar. |
| UnfocusWindow | Remove focus from all windows. |
| VerticalScrollbar | Make a vertical scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead. |
| VerticalSlider | A vertical slider the user can drag to change a value between a min and a max. |
| Window | Make a popup window. |
Delegates
| WindowFunction | Callback to draw GUI within a window (used with GUI.Window). |
Unity学习笔记(4) --- Unity的界面排版:初识GUI的更多相关文章
- 我的Unity学习笔记之——Unity中从网站下载ab资源+下载存储一条龙
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Net ...
- 微软企业库Unity学习笔记
本文主要介绍: 关于Unity container配置,注册映射关系.类型,单实例.已存在对象和指出一些container的基本配置,这只是我关于Unity的学习心得和笔记,希望能够大家多交流相互学习 ...
- Unity3D学习笔记3——Unity Shader的初步使用
目录 1. 概述 2. 详论 2.1. 创建材质 2.2. 着色器 2.2.1. 名称 2.2.2. 属性 2.2.3. SubShader 2.2.3.1. 标签(Tags) 2.2.3.2. 渲染 ...
- Unity学习笔记(3):获取对象
在上一篇文章中(Unity映射注册)中概要介绍了Unity中的映射机制,本节主要介绍对象获取,包括默认获取,通过名称获取,获取全部对象,同时通过加载配置文件,然后再获取对象. 通过代码获取对象 方式1 ...
- Unity学习笔记(2):注册映射
在上一篇文章中(认识Unity)中概要介绍了Unity和Ioc,本节主要介绍IoC中的注册映射,并使用代码和配置文件两种方式进行说明. 定义依赖注入相关信息 定义ILogger接口 public in ...
- Unity学习笔记(1):认识Unity
Unity是什么? Unity是patterns & practices团队开发的一个轻量级.可扩展的依赖注入容器,具有如下的特性: 它提供了创建(或者装配)对象实例的机制,而这些对象实例可能 ...
- Digital Tutors - Creating an Action Adventure Puzzle in Unity学习笔记
遇到的问题: 1 第11节Scripting the pressure plates中需要获取子物体的Animator组件,教程使用的语句如下: ”SwitchAnim = GetComponentI ...
- (转载)Unity学习笔记:关于Dropdown的学习
今天组长让我写一个界面,其中用到了下拉条,我的印象还停留在以前的NGUI有现成的组件,但是uGUI没有的那阶段,组长跟我说uGUI现在也有了,研究了一下,发现real方便哦,今天就来简单说一下用法吧. ...
- Egret3D学习笔记一 (Unity插件使用)
一 官方教程: http://developer.egret.com/cn/github/egret-docs/Engine3D/getStarted/getStarted/index.html 大部 ...
随机推荐
- 计算机二级C语言冲刺笔记。
2018-03-0618:32:26 风萧萧兮易水寒,壮士一去...... 四级依旧没过,计算机二级接踵而至, default语句在switch语句中可以省略,所以B错误:switch语句中并非每个c ...
- acm练习-day1
描述现在,有一行括号序列,请你检查这行括号是否配对.输入第一行输入一个数N(0<N<=100),表示有N组测试数据.后面的N行输入多组输入数据,每组输入数据都是一个字符串S(S的长度小于1 ...
- 浏览器 chrome 360等 加载本地json 或者xml 文件
添加启动参数 --allow-file-access-from-files 来自为知笔记(Wiz)
- 【DVWA】【SQL Injection(Blind)】SQL盲注 Low Medium High Impossible
1.初级篇 Low.php 加单引号提交 http://localhost/DVWA-master/vulnerabilities/sqli_blind/?id=1'&Submit=Submi ...
- 国外一些好用的UX/UI设计工具和资源介绍
你今天使用的设计工具也许不再适合以后的网页和APP设计项目了.新的工具不断的推出市场,目标只有一个,让你的工作更快.更容易而且工作成效更好.以下就是各种工具的介绍入口,当您点击标题就会看到各种很好的工 ...
- 00JavaScript
JavaScript JavaScript是由网景公司开发的一种跨平台面向对象(object-oriented)的网页脚本语言(Web Script Language)是目前流行的网页特效设计语言Ja ...
- 12Cookie、Session
12Cookie.Session-2018/07/24 1.保存会话数据 cookie客户端技术,把每个用户的数据以cookie的形式写给用户各自的浏览器 HttpSession服务端技术,服务器运行 ...
- MFC 程序 手写创建顺序
MFC 程序 手写创建顺序 1.继承CWinApp类 覆盖 class CMyApp : public CWinApp { virtual BOOL InitInstance(); } BOOL CM ...
- 阿里云创建CentOS系统设置
1 首先设置你购买的云盘配置,例如cpu,内存,磁盘类型.容量,网络类型等 2.阿里云可以使用浏览器进行远程shell连接 首先需要输入远程密码,第一次连接的时候会提示 一定要牢记 输入密码后进入sh ...
- mysql的密码管理、mysql初始密码查找、密码修改、mysql登录
1.查询mysql的初始密码: 初始密码密码是随机产生的,每台机器产生的都不一样的 grep 'temporary password' /var/log/mysqld.log 或者 cat /var/ ...