Class DewGUI
Helper class for building custom GUIs.
Inheritance
object
DewGUI
Assembly: Dew.Core.dll
Syntax
public static class DewGUI
Fields
fieldBuilders
Declaration
public static List<(DewGUI.FieldBuilderCondition, DewGUI.FieldBuilder)> fieldBuilders
Field Value
SupportedBasicTypes
Declaration
public static readonly Type[] SupportedBasicTypes
Field Value
| Type |
Description |
| System.Type[] |
|
Properties
Declaration
public static RectTransform canvasTransform { get; }
Property Value
| Type |
Description |
| UnityEngine.RectTransform |
|
Declaration
public static UI_BindItem widgetBindItem { get; }
Property Value
Declaration
public static Button widgetButton { get; }
Property Value
| Type |
Description |
| UnityEngine.UI.Button |
|
Declaration
public static TMP_Dropdown widgetDropdown { get; }
Property Value
| Type |
Description |
| TMPro.TMP_Dropdown |
|
Declaration
public static TMP_InputField widgetInputField { get; }
Property Value
| Type |
Description |
| TMPro.TMP_InputField |
|
Declaration
public static ScrollRect widgetScrollRect { get; }
Property Value
| Type |
Description |
| UnityEngine.UI.ScrollRect |
|
Declaration
public static Slider widgetSlider { get; }
Property Value
| Type |
Description |
| UnityEngine.UI.Slider |
|
widgetTextBody
Declaration
public static TextMeshProUGUI widgetTextBody { get; }
Property Value
| Type |
Description |
| TMPro.TextMeshProUGUI |
|
Declaration
public static TextMeshProUGUI widgetTextHeader { get; }
Property Value
| Type |
Description |
| TMPro.TextMeshProUGUI |
|
widgetTextLabel
Declaration
public static TextMeshProUGUI widgetTextLabel { get; }
Property Value
| Type |
Description |
| TMPro.TextMeshProUGUI |
|
Declaration
public static UI_Toggle widgetToggleButton { get; }
Property Value
Declaration
public static UI_Toggle widgetToggleCheck { get; }
Property Value
The window comes with VerticalLayoutGroup and ContentSizeFitter, and is draggable by default.
Declaration
public static UI_Window widgetWindow { get; }
Property Value
Methods
ApplyLayoutGroupDefaultSettings(HorizontalLayoutGroup, TextAnchor)
Helper for creating layout groups with nice default values.
Declaration
public static void ApplyLayoutGroupDefaultSettings(HorizontalLayoutGroup group, TextAnchor alignment = TextAnchor.MiddleLeft)
Parameters
| Type |
Name |
Description |
| UnityEngine.UI.HorizontalLayoutGroup |
group |
|
| UnityEngine.TextAnchor |
alignment |
|
ApplyLayoutGroupDefaultSettings(VerticalLayoutGroup, TextAnchor)
Helper for creating layout groups with nice default values.
Declaration
public static void ApplyLayoutGroupDefaultSettings(VerticalLayoutGroup group, TextAnchor alignment = TextAnchor.UpperCenter)
Parameters
| Type |
Name |
Description |
| UnityEngine.UI.VerticalLayoutGroup |
group |
|
| UnityEngine.TextAnchor |
alignment |
|
Declaration
public static LayoutElement CreateHorizontalFlexibleSpace(Transform parent)
Parameters
| Type |
Name |
Description |
| UnityEngine.Transform |
parent |
|
Returns
| Type |
Description |
| UnityEngine.UI.LayoutElement |
|
CreateHorizontalLayoutGroup(Transform, TextAnchor)
Helper for creating layout groups with nice default values.
Declaration
public static HorizontalLayoutGroup CreateHorizontalLayoutGroup(Transform parent, TextAnchor alignment = TextAnchor.MiddleLeft)
Parameters
| Type |
Name |
Description |
| UnityEngine.Transform |
parent |
|
| UnityEngine.TextAnchor |
alignment |
|
Returns
| Type |
Description |
| UnityEngine.UI.HorizontalLayoutGroup |
|
Declaration
public static LayoutElement CreateVerticalFlexibleSpace(Transform parent)
Parameters
| Type |
Name |
Description |
| UnityEngine.Transform |
parent |
|
Returns
| Type |
Description |
| UnityEngine.UI.LayoutElement |
|
CreateVerticalLayoutGroup(Transform, TextAnchor)
Helper for creating layout groups with nice default values.
Declaration
public static VerticalLayoutGroup CreateVerticalLayoutGroup(Transform parent, TextAnchor alignment = TextAnchor.UpperCenter)
Parameters
| Type |
Name |
Description |
| UnityEngine.Transform |
parent |
|
| UnityEngine.TextAnchor |
alignment |
|
Returns
| Type |
Description |
| UnityEngine.UI.VerticalLayoutGroup |
|
Creates data-bound widgets for given object type.
Declaration
public static void CreateWidgetsForObject(Type type, object state, Transform parent, out SafeAction onChanged, out SafeAction requestUpdate)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
| object |
state |
|
| UnityEngine.Transform |
parent |
|
| SafeAction |
onChanged |
|
| SafeAction |
requestUpdate |
|
Declaration
public static FieldBuildResult GenericInputFieldBuilder<T>(Transform parent, DewGUI.TryParseFunc<T> tryParse, TMP_InputField.CharacterValidation validation, out TMP_InputField inputField)
Parameters
| Type |
Name |
Description |
| UnityEngine.Transform |
parent |
|
| DewGUI.TryParseFunc<T> |
tryParse |
|
| TMPro.TMP_InputField.TMPro.TMP_InputField.CharacterValidation |
validation |
|
| TMPro.TMP_InputField |
inputField |
|
Returns
Type Parameters
SetExpandHeight(GameObject, bool)
Declaration
public static GameObject SetExpandHeight(this GameObject c, bool expand)
Parameters
| Type |
Name |
Description |
| UnityEngine.GameObject |
c |
|
| bool |
expand |
|
Returns
| Type |
Description |
| UnityEngine.GameObject |
|
SetExpandHeight(GameObject, float)
Declaration
public static GameObject SetExpandHeight(this GameObject c, float value)
Parameters
| Type |
Name |
Description |
| UnityEngine.GameObject |
c |
|
| float |
value |
|
Returns
| Type |
Description |
| UnityEngine.GameObject |
|
SetExpandHeight<T>(T, bool)
Declaration
public static T SetExpandHeight<T>(this T c, bool expand) where T : Component
Parameters
| Type |
Name |
Description |
| T |
c |
|
| bool |
expand |
|
Returns
Type Parameters
SetExpandHeight<T>(T, float)
Declaration
public static T SetExpandHeight<T>(this T c, float value) where T : Component
Parameters
| Type |
Name |
Description |
| T |
c |
|
| float |
value |
|
Returns
Type Parameters
SetExpandWidth(GameObject, bool)
Declaration
public static GameObject SetExpandWidth(this GameObject c, bool expand)
Parameters
| Type |
Name |
Description |
| UnityEngine.GameObject |
c |
|
| bool |
expand |
|
Returns
| Type |
Description |
| UnityEngine.GameObject |
|
SetExpandWidth(GameObject, float)
Declaration
public static GameObject SetExpandWidth(this GameObject c, float value)
Parameters
| Type |
Name |
Description |
| UnityEngine.GameObject |
c |
|
| float |
value |
|
Returns
| Type |
Description |
| UnityEngine.GameObject |
|
SetExpandWidth<T>(T, bool)
Declaration
public static T SetExpandWidth<T>(this T c, bool expand) where T : Component
Parameters
| Type |
Name |
Description |
| T |
c |
|
| bool |
expand |
|
Returns
Type Parameters
SetExpandWidth<T>(T, float)
Declaration
public static T SetExpandWidth<T>(this T c, float value) where T : Component
Parameters
| Type |
Name |
Description |
| T |
c |
|
| float |
value |
|
Returns
Type Parameters
SetHeight(GameObject, float)
Declaration
public static GameObject SetHeight(this GameObject c, float height)
Parameters
| Type |
Name |
Description |
| UnityEngine.GameObject |
c |
|
| float |
height |
|
Returns
| Type |
Description |
| UnityEngine.GameObject |
|
SetHeight<T>(T, float)
Declaration
public static T SetHeight<T>(this T c, float height) where T : Component
Parameters
| Type |
Name |
Description |
| T |
c |
|
| float |
height |
|
Returns
Type Parameters
SetText(GameObject, string)
Declaration
public static GameObject SetText(this GameObject c, string text)
Parameters
| Type |
Name |
Description |
| UnityEngine.GameObject |
c |
|
| string |
text |
|
Returns
| Type |
Description |
| UnityEngine.GameObject |
|
SetText<T>(T, string)
Declaration
public static T SetText<T>(this T c, string text) where T : Component
Parameters
| Type |
Name |
Description |
| T |
c |
|
| string |
text |
|
Returns
Type Parameters
SetTextLocalized(GameObject, string)
Declaration
public static GameObject SetTextLocalized(this GameObject c, string key)
Parameters
| Type |
Name |
Description |
| UnityEngine.GameObject |
c |
|
| string |
key |
|
Returns
| Type |
Description |
| UnityEngine.GameObject |
|
SetTextLocalized<T>(T, string)
Declaration
public static T SetTextLocalized<T>(this T c, string key) where T : Component
Parameters
| Type |
Name |
Description |
| T |
c |
|
| string |
key |
|
Returns
Type Parameters
SetWidth(GameObject, float)
Declaration
public static GameObject SetWidth(this GameObject c, float width)
Parameters
| Type |
Name |
Description |
| UnityEngine.GameObject |
c |
|
| float |
width |
|
Returns
| Type |
Description |
| UnityEngine.GameObject |
|
SetWidth<T>(T, float)
Declaration
public static T SetWidth<T>(this T c, float width) where T : Component
Parameters
| Type |
Name |
Description |
| T |
c |
|
| float |
width |
|
Returns
Type Parameters