Summary
[Editor-Only] Various GUI utilities used throughout Animancer.
- Assembly
- Animancer
.dll - Namespace
- Animancer
.Editor - Base Types
-
- Object
graph BT
Type-->Base0["Object"]
Type["AnimancerGUI"]
class Type type-node
Syntax
public static class AnimancerGUI
Fields
| Name | Constant Value | Summary |
|---|---|---|
| DontExpandWidth |
UnityEngine.GUILayout.ExpandWidth(System.Boolean) set to false.static
|
|
| ErrorFieldColor |
The highlight color used for fields showing an error.
static
|
|
| WarningFieldColor |
The highlight color used for fields showing a warning.
static
|
Properties
| Name | Value | Summary |
|---|---|---|
| GuiOffset | Vector2 |
The offset currently applied to the GUI by
UnityEngine.GUI.BeginGroup(UnityEngine.Rect).static
|
| IndentSize | float |
The number of pixels of indentation for each
UnityEditor.EditorGUI.indentLevel increment.
static
|
| LineHeight | float |
Returns
UnityEditor.EditorGUIUtility.singleLineHeight.static
|
| MiniButtonNoPadding | GUIStyle |
A more compact
UnityEditor.EditorStyles.miniButton with no padding for its content.static
|
| MiniButtonStyle | GUIStyle |
A more compact
UnityEditor.EditorStyles.miniButton with a fixed size as a tiny box.static
|
| NoPaddingButtonStyle | GUIStyle |
Animancer.Editor.AnimancerGUI.MiniButtonStyle with no UnityEngine.GUIStyle.padding.static
|
| RightLabelStyle | GUIStyle |
UnityEditor.EditorStyles.label using UnityEngine.TextAnchor.MiddleRight.static
|
| StandardSpacing | float |
Returns
UnityEditor.EditorGUIUtility.standardVerticalSpacing.static
|
| TextColor | Color |
The color of the standard label text.
static
|
| ToggleWidth | float |
The width of a standard
UnityEngine.GUISkin.toggle with no label.static
|
Methods
| Name | Value | Summary |
|---|---|---|
| BeginTightLabel |
string |
Stores the
UnityEditor.EditorGUIUtility.labelWidth and changes it to the exact width of the `label`.
static
|
| BeginTriangles |
void |
Sets up the rendering details for
Animancer.Editor.AnimancerGUI.DrawLineBatched(UnityEngine.Vector2,UnityEngine.Vector2,System.Single).static
|
| BeginVerticalBox |
void |
Begins a vertical layout group using the given style and decreases the
UnityEditor.EditorGUIUtility.labelWidth to compensate for the indentation.
static
|
| CalculateHeight |
float |
Calculates the number of vertical pixels required to draw the specified `lineCount` using the
Animancer.Editor.AnimancerGUI.LineHeight and Animancer.Editor.AnimancerGUI.StandardSpacing.
static
|
| CalculateLabelWidth |
float |
Calls
UnityEngine.GUIStyle.CalcMinMaxWidth(UnityEngine.GUIContent,System.Single@,System.Single@) using UnityEngine.GUISkin.label and returns the max
width. The result is cached for efficient reuse.
static
|
| CalculateWidth |
float |
[Animancer Extension] Calls
UnityEngine.GUIStyle.CalcMinMaxWidth(UnityEngine.GUIContent,System.Single@,System.Single@) and returns the max width.static
|
| CalculateWidth |
float |
[Animancer Extension] Calls
UnityEngine.GUIStyle.CalcMinMaxWidth(UnityEngine.GUIContent,System.Single@,System.Single@) and returns the max width.static
|
| CompactMiniButton |
bool |
Draws a button using
UnityEditor.EditorStyles.miniButton and Animancer.Editor.AnimancerGUI.DontExpandWidth.static
|
| CompactMiniButton |
bool |
Draws a button using
UnityEditor.EditorStyles.miniButton.static
|
| Deselect |
void |
Deselects any selected IMGUI control.
static
|
| Do |
bool |
Draws an object reference field with a dropdown button as its label
and returns true if clicked.
static
|
| DoHashedFoldoutGUI |
bool |
Draws a foldout which stores its state in a hash set.
static
|
| Do |
bool |
Draws a label field with a foldout.
static
|
| Do |
bool |
Draws a label field with a foldout.
static
|
| DoObjectFieldGUI |
T |
Draws an object reference field.
static
|
| DoObjectFieldGUI |
T |
Draws an object reference field.
static
|
| DoObjectFieldGUI |
T |
Draws an object reference field.
static
|
| DoObjectFieldGUI |
T |
Draws an object reference field.
static
|
| DoPlayPauseToggle |
bool |
Draws a button which toggles between play and pause icons.
static
|
| DoWeightLabel |
void |
Draws a label showing the `weight` aligned to the right side of the `area` and reduces its
UnityEngine.Rect.width to remove that label from its area.
static
|
| Draw |
void |
Draws triangular arrow.
static
|
| DrawLine |
void |
Draws a line.
static
|
| DrawLineBatched |
void |
Draws a line.
static
|
| DrawSprite |
void |
Draws a `sprite` in the given `area`.
static
|
| Encapsulate |
Rect |
Returns a copy of the `rect` expanded to include the `other`.
static
|
| EndTightLabel |
void |
Reverts
UnityEditor.EditorGUIUtility.labelWidth to its previous value.static
|
| EndTriangles |
void |
Cleans up the rendering details for
Animancer.Editor.AnimancerGUI.DrawLineBatched(UnityEngine.Vector2,UnityEngine.Vector2,System.Single).static
|
| EndVerticalBox |
void |
Ends a layout group started by
Animancer.Editor.AnimancerGUI.BeginVerticalBox(UnityEngine.GUIStyle) and restores the
UnityEditor.EditorGUIUtility.labelWidth.
static
|
| Expand |
Rect |
Returns a copy of the `rect` expanded by the specified `amount`
(or contracted if negative).
static
|
| Expand |
Rect |
Returns a copy of the `rect` expanded by the specified amounts
on each axis (or contracted if negative).
static
|
| GetGUIClipRect |
Rect |
Returns the
UnityEngine.Rect of the current UnityEngine.GUI.BeginClip(UnityEngine.Rect).static
|
| GetHashColor |
Color |
Returns a colour with its hue based on the `hash`.
static
|
| GetPerpendicular |
Vector2 |
Returns a vector perpendicular to the given value with the same magnitude.
static
|
| Grey |
Color |
Returns a color with uniform Red, Green, and Blue values.
static
|
| Handle |
bool |
Handles the current event.
static
|
| Handle |
bool |
Handles the current event.
static
|
| IsMiddleClick |
bool |
Is the `currentEvent` a Middle Click or Alt + Left Click?
static
|
| LayoutRect |
Rect |
UnityEngine.GUILayoutUtility.GetRect(System.Single,System.Single)static
|
| LayoutRect |
Rect |
Uses
UnityEngine.GUILayoutUtility.GetRect(System.Single,System.Single) to get a UnityEngine.Rect with the specified
`height` and the Animancer.Editor.AnimancerGUI.StandardSpacing added according to the specified `spacing`.
static
|
| LayoutRect |
Rect |
UnityEngine.GUILayoutUtility.GetRect(System.Single,System.Single,UnityEngine.GUIStyle)static
|
| LayoutSingleLineRect |
Rect |
Uses
UnityEngine.GUILayoutUtility.GetRect(System.Single,System.Single) to get a UnityEngine.Rect occupying a single
standard line with the Animancer.Editor.AnimancerGUI.StandardSpacing added according to the specified `spacing`.
static
|
| NextVerticalArea |
void |
If the
UnityEngine.Rect.height is positive, this method moves the UnityEngine.Rect.y by that amount and
adds the Animancer.Editor.AnimancerGUI.StandardSpacing.
static
|
| RepaintEverything |
void |
Calls
UnityEditorInternal.InternalEditorUtility.RepaintAllViews.static
|
| Re |
void |
Clears the
UnityEditor.Selection.objects then returns it to its current state.static
|
| SetGuiChanged |
void |
Sets
UnityEngine.GUI.changed if `guiChanged` is true.static
|
| SplitHorizontally |
void |
Divides the given `area` such that the fields associated with both labels will have equal space
remaining after the labels themselves.
static
|
| StealFromLeft |
Rect |
Subtracts the `width` from the left side of the `area`
and returns a new
UnityEngine.Rect occupying the removed section.
static
|
| StealFromRight |
Rect |
Subtracts the `width` from the right side of the `area`
and returns a new
UnityEngine.Rect occupying the removed section.
static
|
| StealFromTop |
Rect |
Subtracts the `height` from the top side of the `area`
and returns a new
UnityEngine.Rect occupying the removed section.
static
|
| StealLineFromTop |
Rect |
Subtracts the
Animancer.Editor.AnimancerGUI.LineHeight from the top side of the `area`
and returns a new UnityEngine.Rect occupying the removed section.
static
|
| ToStringCached |
string |
Caches and returns
System.Int32.ToString if 0 <= value < 100.static
|
| TryUseClickEvent |
bool |
Returns true and uses the current event if it is
UnityEngine.EventType.MouseUp inside the specified `area`.
static
|
| Try |
bool |
Returns true and uses the current event if it is
UnityEngine.EventType.MouseUp inside the last GUI Layout
UnityEngine.Rect that was drawn.
static
|
| TryUseHotControl |
bool |
Uses the `currentEvent` and sets
UnityEngine.GUI.changed
if the `controlID` matches the UnityEngine.GUIUtility.hotControl.
static
|
| TryUseKey |
bool |
Uses the `currentEvent` if the `controlID` has
UnityEngine.GUIUtility.keyboardControl.
If a `key` is specified, other keys will be ignored.
static
|
| TryUseMouseDown |
bool |
Sets the
UnityEngine.GUIUtility.hotControl and uses the `currentEvent`
if the mouse position is inside the `area`.
static
|
| TryUseMouseUp |
bool |
Releases the
UnityEngine.GUIUtility.hotControl and uses the `currentEvent` if it was the active control.
static
|
| Use |
void |
Calls
UnityEngine.Event.Use and sets the
UnityEngine.GUI.changed and UnityEngine.GUIUtility.hotControl.
static
|