Unity學習筆記(4) --- Unity的界面排版:初識GUI
來自: http://blog.csdn.net//likendsl/article/details/50265835
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). |
本文由用戶 govdoo 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!