Skip to content

Class: DewGUI ​

  • Namespace: Global
  • Assembly: Dew.Core.dll
csharp
public static class DewGUI

Fields ​

NameDeclarationDescription
fieldBuilderspublic static List<(DewGUI.FieldBuilderCondition, DewGUI.FieldBuilder)> fieldBuilders
SupportedBasicTypespublic static readonly Type[] SupportedBasicTypes

Properties ​

NameDeclarationDescription
canvasTransformpublic static RectTransform canvasTransform { get; }
widgetBindItempublic static UI_BindItem widgetBindItem { get; }
widgetButtonpublic static Button widgetButton { get; }
widgetDropdownpublic static TMP_Dropdown widgetDropdown { get; }
widgetInputFieldpublic static TMP_InputField widgetInputField { get; }
widgetScrollRectpublic static ScrollRect widgetScrollRect { get; }
widgetSliderpublic static Slider widgetSlider { get; }
widgetTextBodypublic static TextMeshProUGUI widgetTextBody { get; }
widgetTextHeaderpublic static TextMeshProUGUI widgetTextHeader { get; }
widgetTextLabelpublic static TextMeshProUGUI widgetTextLabel { get; }
widgetToggleButtonpublic static UI_Toggle widgetToggleButton { get; }
widgetToggleCheckpublic static UI_Toggle widgetToggleCheck { get; }
widgetWindowpublic static UI_Window widgetWindow { get; }The window comes with VerticalLayoutGroup and ContentSizeFitter, and is draggable by default.

Methods ​

ApplyLayoutGroupDefaultSettings(HorizontalLayoutGroup, TextAnchor) ​

Helper for creating layout groups with nice default values.

csharp
public static void ApplyLayoutGroupDefaultSettings(HorizontalLayoutGroup group, TextAnchor alignment = TextAnchor.MiddleLeft)

Parameters:

NameTypeDescription
groupUnityEngine.UI.HorizontalLayoutGroup
alignmentUnityEngine.TextAnchor

ApplyLayoutGroupDefaultSettings(VerticalLayoutGroup, TextAnchor) ​

Helper for creating layout groups with nice default values.

csharp
public static void ApplyLayoutGroupDefaultSettings(VerticalLayoutGroup group, TextAnchor alignment = TextAnchor.UpperCenter)

Parameters:

NameTypeDescription
groupUnityEngine.UI.VerticalLayoutGroup
alignmentUnityEngine.TextAnchor

CreateHorizontalFlexibleSpace(Transform) ​

csharp
public static LayoutElement CreateHorizontalFlexibleSpace(Transform parent)

Parameters:

NameTypeDescription
parentUnityEngine.Transform

Returns: UnityEngine.UI.LayoutElement

CreateHorizontalLayoutGroup(Transform, TextAnchor) ​

Helper for creating layout groups with nice default values.

csharp
public static HorizontalLayoutGroup CreateHorizontalLayoutGroup(Transform parent, TextAnchor alignment = TextAnchor.MiddleLeft)

Parameters:

NameTypeDescription
parentUnityEngine.Transform
alignmentUnityEngine.TextAnchor

Returns: UnityEngine.UI.HorizontalLayoutGroup

CreateVerticalFlexibleSpace(Transform) ​

csharp
public static LayoutElement CreateVerticalFlexibleSpace(Transform parent)

Parameters:

NameTypeDescription
parentUnityEngine.Transform

Returns: UnityEngine.UI.LayoutElement

CreateVerticalLayoutGroup(Transform, TextAnchor) ​

Helper for creating layout groups with nice default values.

csharp
public static VerticalLayoutGroup CreateVerticalLayoutGroup(Transform parent, TextAnchor alignment = TextAnchor.UpperCenter)

Parameters:

NameTypeDescription
parentUnityEngine.Transform
alignmentUnityEngine.TextAnchor

Returns: UnityEngine.UI.VerticalLayoutGroup

CreateWidgetsForObject(Type, object, Transform, out SafeAction, out SafeAction) ​

Creates data-bound widgets for given object type.

csharp
public static void CreateWidgetsForObject(Type type, object state, Transform parent, out SafeAction onChanged, out SafeAction requestUpdate)

Parameters:

NameTypeDescription
typeSystem.Type
stateobject
parentUnityEngine.Transform
onChangedSafeAction
requestUpdateSafeAction

GenericInputFieldBuilder<T>(Transform, TryParseFunc<T>, CharacterValidation, out TMP_InputField) ​

csharp
public static FieldBuildResult GenericInputFieldBuilder<T>(Transform parent, DewGUI.TryParseFunc<T> tryParse, TMP_InputField.CharacterValidation validation, out TMP_InputField inputField)

Parameters:

NameTypeDescription
parentUnityEngine.Transform
tryParseDewGUI.TryParseFunc<T>
validationTMPro.TMP_InputField.TMPro.TMP_InputField.CharacterValidation
inputFieldTMPro.TMP_InputField
``T

Returns: FieldBuildResult

SetExpandHeight(GameObject, bool) ​

csharp
public static GameObject SetExpandHeight(this GameObject c, bool expand)

Parameters:

NameTypeDescription
cUnityEngine.GameObject
expandbool

Returns: UnityEngine.GameObject

SetExpandHeight(GameObject, float) ​

csharp
public static GameObject SetExpandHeight(this GameObject c, float value)

Parameters:

NameTypeDescription
cUnityEngine.GameObject
valuefloat

Returns: UnityEngine.GameObject

SetExpandHeight&lt;T&gt;(T, bool) ​

csharp
public static T SetExpandHeight<T>(this T c, bool expand) where T : Component

Parameters:

NameTypeDescription
cT
expandbool
``T

Returns: T

SetExpandHeight&lt;T&gt;(T, float) ​

csharp
public static T SetExpandHeight<T>(this T c, float value) where T : Component

Parameters:

NameTypeDescription
cT
valuefloat
``T

Returns: T

SetExpandWidth(GameObject, bool) ​

csharp
public static GameObject SetExpandWidth(this GameObject c, bool expand)

Parameters:

NameTypeDescription
cUnityEngine.GameObject
expandbool

Returns: UnityEngine.GameObject

SetExpandWidth(GameObject, float) ​

csharp
public static GameObject SetExpandWidth(this GameObject c, float value)

Parameters:

NameTypeDescription
cUnityEngine.GameObject
valuefloat

Returns: UnityEngine.GameObject

SetExpandWidth&lt;T&gt;(T, bool) ​

csharp
public static T SetExpandWidth<T>(this T c, bool expand) where T : Component

Parameters:

NameTypeDescription
cT
expandbool
``T

Returns: T

SetExpandWidth&lt;T&gt;(T, float) ​

csharp
public static T SetExpandWidth<T>(this T c, float value) where T : Component

Parameters:

NameTypeDescription
cT
valuefloat
``T

Returns: T

SetHeight(GameObject, float) ​

csharp
public static GameObject SetHeight(this GameObject c, float height)

Parameters:

NameTypeDescription
cUnityEngine.GameObject
heightfloat

Returns: UnityEngine.GameObject

SetHeight&lt;T&gt;(T, float) ​

csharp
public static T SetHeight<T>(this T c, float height) where T : Component

Parameters:

NameTypeDescription
cT
heightfloat
``T

Returns: T

SetText(GameObject, string) ​

csharp
public static GameObject SetText(this GameObject c, string text)

Parameters:

NameTypeDescription
cUnityEngine.GameObject
textstring

Returns: UnityEngine.GameObject

SetText&lt;T&gt;(T, string) ​

csharp
public static T SetText<T>(this T c, string text) where T : Component

Parameters:

NameTypeDescription
cT
textstring
``T

Returns: T

SetTextLocalized(GameObject, string) ​

csharp
public static GameObject SetTextLocalized(this GameObject c, string key)

Parameters:

NameTypeDescription
cUnityEngine.GameObject
keystring

Returns: UnityEngine.GameObject

SetTextLocalized&lt;T&gt;(T, string) ​

csharp
public static T SetTextLocalized<T>(this T c, string key) where T : Component

Parameters:

NameTypeDescription
cT
keystring
``T

Returns: T

SetWidth(GameObject, float) ​

csharp
public static GameObject SetWidth(this GameObject c, float width)

Parameters:

NameTypeDescription
cUnityEngine.GameObject
widthfloat

Returns: UnityEngine.GameObject

SetWidth&lt;T&gt;(T, float) ​

csharp
public static T SetWidth<T>(this T c, float width) where T : Component

Parameters:

NameTypeDescription
cT
widthfloat
``T

Returns: T

Maintained by the Shape of Dreams Modding Community