The root of a GUI layout. More...
Public Member Functions | |
void | OnGUI () |
Draws the GUI layout. More... | |
void | ManualRefresh () |
Tells the root to recalculate the sizes, positions, and appearance of all of its children. More... | |
Public Member Functions inherited from PixelCrushers.DialogueSystem.UnityGUI.GUIControl | |
virtual void | Awake () |
virtual void | OnEnable () |
Checks if the control needs to enable the first child for key/controller navigation. More... | |
void | Draw (Vector2 relativeMousePosition) |
Draw the control and its children. More... | |
virtual void | DrawSelf (Vector2 relativeMousePosition) |
Draws the control, but not its children. More... | |
virtual void | DrawChildren (Vector2 relativeMousePosition) |
Draws the children, taking into account key/controller navigation if enabled. More... | |
virtual void | Update () |
If navigation is enabled, check if the selection button was pressed. More... | |
virtual void | Refresh (Vector2 windowSize) |
Marks a control as needing to update its layout. More... | |
virtual void | Refresh () |
virtual void | UpdateLayout () |
Updates the layout (size, position, formatting, etc.) of the control and its children. More... | |
virtual void | UpdateLayoutSelf () |
Updates the control's layout but not its children. More... | |
virtual void | AutoSizeSelf () |
Auto-sizes the control according to the autoSize settings. More... | |
Public Attributes | |
GUISkin | guiSkin |
The GUI skin to apply to all of the child controls. More... | |
Public Attributes inherited from PixelCrushers.DialogueSystem.UnityGUI.GUIControl | |
int | depth = 0 |
The drawing order depth. More... | |
bool | depthSortChildren = false |
If true , children are drawn in depth order; otherwise no specific order. More... | |
ScaledRect | scaledRect = new ScaledRect(ScaledRect.wholeScreen) |
The scaled rect defining the position of the control. More... | |
AutoSize | autoSize |
Auto-size settings. More... | |
Fit | fit |
Fit settings. More... | |
Navigation | navigation |
Keyboard/controller navigation settings. More... | |
bool | visible = true |
If true , this control and its children are visible. More... | |
bool | clipChildren = true |
Clip children to the control's bounds? More... | |
Additional Inherited Members | |
Protected Member Functions inherited from PixelCrushers.DialogueSystem.UnityGUI.GUIControl | |
virtual void | FitSelf () |
Fits the control according to the fit settings. More... | |
Properties inherited from PixelCrushers.DialogueSystem.UnityGUI.GUIControl | |
Rect | rect [get, set] |
The pixel rect represented by scaledRect. More... | |
Vector2 | Offset [get, set] |
Gets or sets the offset to apply to the screen rect for this control; useful for manual repositioning outside the normal GUI control system. More... | |
List< GUIControl > | Children [get] |
The child controls. More... | |
bool | NeedToUpdateLayout [get, set] |
When true , the control needs to update its style, size, position, etc. More... | |
Vector2 | WindowSize [get, set] |
The size of the window most recently passed to Refresh(). More... | |
bool | IsNavigationEnabled [get] |
Gets a value indicating whether keyboard/controller navigation is enabled. More... | |
string | FullName [get] |
Gets the full name of the GameObject, used to focus the control when using keyboard/controller navigation. More... | |
Vector2 | dRect [get, set] |
Gets or sets dRect, which offsets the rect when the parent window isn't clipping. More... | |
The root of a GUI layout.
Place all child controls under the root's hierarchy. The root applies a GUI skin to the layout, and refreshes the entire layout as necessary.
Only the root has an OnGUI method. All child controls are drawn from the root's OnGUI. This is much more efficient than giving each child its own OnGUI, since each OnGUI call requires substantial internal overhead to set up in Unity. To hide a GUI layout, you only need to disable the GUIRoot component or deactivate its game object.
GUIRoot updates in editor mode. This allows you to view changes on the fly (WYSIWYG editing).
void PixelCrushers.DialogueSystem.UnityGUI.GUIRoot.ManualRefresh | ( | ) |
Tells the root to recalculate the sizes, positions, and appearance of all of its children.
void PixelCrushers.DialogueSystem.UnityGUI.GUIRoot.OnGUI | ( | ) |
Draws the GUI layout.
GUISkin PixelCrushers.DialogueSystem.UnityGUI.GUIRoot.guiSkin |
The GUI skin to apply to all of the child controls.