Unity学习笔记(4) --- Unity的界面排版:初识GUI
来源:互联网 发布:猫咪软件 编辑:程序博客网 时间:2024/05/21 18:49
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
backgroundColorGlobal tinting color for all background elements rendered by the GUI.changedReturns true if any controls changed the value of the input data.colorGlobal tinting color for the GUI.contentColorTinting color for all text rendered by the GUI.depthThe sorting depth of the currently executing GUI behaviour.enabledIs the GUI enabled?matrixThe GUI transform matrix.skinThe global skin to use.tooltipThe tooltip of the control the mouse is currently over, or which has keyboard focus. (Read Only).Static Functions
BeginGroupBegin a group. Must be matched with a call to EndGroup.BeginScrollViewBegin a scrolling view inside your GUI.BoxMake a graphical box.BringWindowToBackBring a specific window to back of the floating windows.BringWindowToFrontBring a specific window to front of the floating windows.ButtonMake a single press button. The user clicks them and something happens immediately.DragWindowMake a window draggable.DrawTextureDraw a texture within a rectangle.DrawTextureWithTexCoordsDraw a texture within a rectangle with the given texture coordinates. Use this function for clipping or tiling the image within the given rectangle.EndGroupEnd a group.EndScrollViewEnds a scrollview started with a call to BeginScrollView.FocusControlMove keyboard focus to a named control.FocusWindowMake a window become the active window.GetNameOfFocusedControlGet the name of named control that has focus.HorizontalScrollbarMake a horizontal scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead.HorizontalSliderA horizontal slider the user can drag to change a value between a min and a max.LabelMake a text or texture label on screen.ModalWindowShow a Modal Window.PasswordFieldMake a text field where the user can enter a password.RepeatButtonMake a button that is active as long as the user holds it down.ScrollToScrolls all enclosing scrollviews so they try to make position visible.SelectionGridMake a grid of buttons.SetNextControlNameSet the name of the next control.TextAreaMake a Multi-line text area where the user can edit a string.TextFieldMake a single-line text field where the user can edit a string.ToggleMake an on/off toggle button.ToolbarMake a toolbar.UnfocusWindowRemove focus from all windows.VerticalScrollbarMake a vertical scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead.VerticalSliderA vertical slider the user can drag to change a value between a min and a max.WindowMake a popup window.Delegates
WindowFunctionCallback 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
backgroundColorGlobal tinting color for all background elements rendered by the GUI.changedReturns true if any controls changed the value of the input data.colorGlobal tinting color for the GUI.contentColorTinting color for all text rendered by the GUI.depthThe sorting depth of the currently executing GUI behaviour.enabledIs the GUI enabled?matrixThe GUI transform matrix.skinThe global skin to use.tooltipThe tooltip of the control the mouse is currently over, or which has keyboard focus. (Read Only).Static Functions
BeginGroupBegin a group. Must be matched with a call to EndGroup.BeginScrollViewBegin a scrolling view inside your GUI.BoxMake a graphical box.BringWindowToBackBring a specific window to back of the floating windows.BringWindowToFrontBring a specific window to front of the floating windows.ButtonMake a single press button. The user clicks them and something happens immediately.DragWindowMake a window draggable.DrawTextureDraw a texture within a rectangle.DrawTextureWithTexCoordsDraw a texture within a rectangle with the given texture coordinates. Use this function for clipping or tiling the image within the given rectangle.EndGroupEnd a group.EndScrollViewEnds a scrollview started with a call to BeginScrollView.FocusControlMove keyboard focus to a named control.FocusWindowMake a window become the active window.GetNameOfFocusedControlGet the name of named control that has focus.HorizontalScrollbarMake a horizontal scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead.HorizontalSliderA horizontal slider the user can drag to change a value between a min and a max.LabelMake a text or texture label on screen.ModalWindowShow a Modal Window.PasswordFieldMake a text field where the user can enter a password.RepeatButtonMake a button that is active as long as the user holds it down.ScrollToScrolls all enclosing scrollviews so they try to make position visible.SelectionGridMake a grid of buttons.SetNextControlNameSet the name of the next control.TextAreaMake a Multi-line text area where the user can edit a string.TextFieldMake a single-line text field where the user can edit a string.ToggleMake an on/off toggle button.ToolbarMake a toolbar.UnfocusWindowRemove focus from all windows.VerticalScrollbarMake a vertical scrollbar. Scrollbars are what you use to scroll through a document. Most likely, you want to use scrollViews instead.VerticalSliderA vertical slider the user can drag to change a value between a min and a max.WindowMake a popup window.Delegates
WindowFunctionCallback to draw GUI within a window (used with GUI.Window). 1 0
- Unity学习笔记(4) --- Unity的界面排版:初识GUI
- Unity学习笔记(3) --- Unity的界面排版:初识GUILayout
- Unity学习笔记(4) --- Unity的界面排版: RectTransform
- Unity学习笔记(5) --- Unity的界面排版:AutoLayout详解——关于高度height的计算
- unity学习之GUI登陆界面
- unity界面的学习
- Unity学习之GUI
- Unity学习之GUI
- unity学习之GUI
- unity学习笔记4
- unity的GUI
- [Unity]界面GUI程序常用的脚本类
- unity界面学习01
- Unity学习笔记——Unity基础一:unity界面、场景、游戏物体、组件等基本概念
- Unity学习之GUI基础
- Unity5.x学习笔记(1)-Unity GUI
- Unity 界面制作工具EZ GUI介绍
- Unity数据库的学习笔记
- 在CodeBlocks环境下使用boost库
- Linux I2C设备驱动编写(一)
- 使用mod_jk整合Apache HTTP Server和Tomcat
- android学习之控件的事件监听的四种写法
- 如何清除本地shell历史记录
- Unity学习笔记(4) --- Unity的界面排版:初识GUI
- Java学习笔记----事件驱动程序设计
- 5.2、SSAS-维度-基本知识
- grunt uglify 压缩中文乱码
- oracle删除表操作,10g之前的不适用
- 机器学习技法作业7
- 中文Win7下成功安装calabash-android步骤
- 5.2.1、SSAS-维度-雪花维度
- Linux I2C设备驱动编写(二)