Class UiKit
- Namespace
- SurvivorsMaker.Presentation
- Assembly
- SurvivorsMaker.Presentation.dll
Shared hierarchy construction used by the reproducible prefab builder.
public static class UiKit
- Inheritance
-
UiKit
- Inherited Members
Methods
AddBorder(Component, UiTheme)
A fine rounded border over surface, outside its layout.
public static Image AddBorder(Component surface, UiTheme theme)
Parameters
surfaceComponentthemeUiTheme
Returns
- Image
ApplyButtonSprites(Button, UiTheme)
public static void ApplyButtonSprites(Button button, UiTheme theme)
Parameters
buttonButtonthemeUiTheme
ApplyPanelSprite(Image, UiTheme)
public static void ApplyPanelSprite(Image image, UiTheme theme)
Parameters
imageImagethemeUiTheme
ApplySelectableColors(Selectable, UiTheme)
Tint states for sliders, dropdowns and toggles from the theme (buttons use UiButtonVisual).
public static void ApplySelectableColors(Selectable selectable, UiTheme theme)
Parameters
selectableSelectablethemeUiTheme
ApplySelectableColors(Selectable, UiTheme, Color, Color, Color)
public static void ApplySelectableColors(Selectable selectable, UiTheme theme, Color normal, Color hover, Color pressed)
Parameters
selectableSelectablethemeUiThemenormalColorhoverColorpressedColor
Bar(Transform, string, Color, UiTheme)
public static Image Bar(Transform parent, string name, Color color, UiTheme theme)
Parameters
Returns
- Image
Button(Transform, string, string, UiTheme, UiButtonKind)
A rounded button with state colours, a fine border (secondary/danger) and a focus ring.
public static Button Button(Transform parent, string name, string value, UiTheme theme, UiButtonKind kind = UiButtonKind.Primary)
Parameters
parentTransformnamestringvaluestringthemeUiThemekindUiButtonKind
Returns
- Button
ButtonText(Button, string)
public static void ButtonText(Button button, string text)
Parameters
buttonButtontextstring
Card(Transform, string, UiTheme, UiColorRole, bool)
A rounded panel or card fill with a fine border; role picks the surface level.
public static Image Card(Transform parent, string name, UiTheme theme, UiColorRole role = UiColorRole.Surface, bool raycast = false)
Parameters
parentTransformnamestringthemeUiThemeroleUiColorRoleraycastbool
Returns
- Image
CardColumn(Transform, string, UiTheme, float)
A card with a padded vertical layout, for grouped content (selectors, stats).
public static RectTransform CardColumn(Transform parent, string name, UiTheme theme, float spacing = -1)
Parameters
Returns
- RectTransform
Column(Transform, string, UiTheme)
public static RectTransform Column(Transform parent, string name, UiTheme theme)
Parameters
Returns
- RectTransform
Dropdown(Transform, string, UiTheme)
A TextMesh Pro dropdown drawn like a secondary button, its list like a panel.
public static TMP_Dropdown Dropdown(Transform parent, string name, UiTheme theme)
Parameters
Returns
- TMP_Dropdown
Fixed(RectTransform, float, float)
public static void Fixed(RectTransform rect, float width, float height)
Parameters
Font(TextMeshProUGUI, UiFontRole, UiTheme)
Changes a generated label's size role (e.g. a small caption built with the body size).
public static TextMeshProUGUI Font(TextMeshProUGUI label, UiFontRole role, UiTheme theme)
Parameters
labelTextMeshProUGUIroleUiFontRolethemeUiTheme
Returns
- TextMeshProUGUI
GridScroll(Transform, string, UiTheme)
public static RectTransform GridScroll(Transform parent, string name, UiTheme theme)
Parameters
Returns
- RectTransform
Group(Component, bool)
public static CanvasGroup Group(Component target, bool blocksRaycasts = false)
Parameters
targetComponentblocksRaycastsbool
Returns
- CanvasGroup
IgnoreLayout(RectTransform)
Takes the element out of its parent's layout (overlays such as borders and badges).
public static void IgnoreLayout(RectTransform rect)
Parameters
rectRectTransform
Image(Transform, string, Color, bool)
public static Image Image(Transform parent, string name, Color color, bool raycast = false)
Parameters
Returns
- Image
Label(Transform, string, string, UiTheme, int)
public static TextMeshProUGUI Label(Transform parent, string name, string value, UiTheme theme, int size = 0)
Parameters
Returns
- TextMeshProUGUI
Layout(RectTransform, float, float, float)
public static LayoutElement Layout(RectTransform rect, float height = -1, float width = -1, float flex = -1)
Parameters
Returns
- LayoutElement
Place(RectTransform, Vector2, Vector2, Vector2, Vector2)
Absolute placement for overlay pieces that live outside layout groups.
public static RectTransform Place(RectTransform rect, Vector2 anchor, Vector2 pivot, Vector2 position, Vector2 size)
Parameters
rectRectTransformanchorVector2pivotVector2positionVector2sizeVector2
Returns
- RectTransform
Rect(Transform, string)
public static RectTransform Rect(Transform parent, string name)
Parameters
parentTransformnamestring
Returns
- RectTransform
Role(TextMeshProUGUI, UiColorRole, UiTheme)
Changes a generated label's colour role, keeping theme edits working.
public static TextMeshProUGUI Role(TextMeshProUGUI label, UiColorRole role, UiTheme theme)
Parameters
labelTextMeshProUGUIroleUiColorRolethemeUiTheme
Returns
- TextMeshProUGUI
RoleImage(Transform, string, UiTheme, UiColorRole, bool)
An image whose colour follows a theme role (and optionally the panel sprite) after regeneration.
public static Image RoleImage(Transform parent, string name, UiTheme theme, UiColorRole role, bool panelSprite = false)
Parameters
parentTransformnamestringthemeUiThemeroleUiColorRolepanelSpritebool
Returns
- Image
Row(Transform, string, UiTheme, float)
public static RectTransform Row(Transform parent, string name, UiTheme theme, float height = -1)
Parameters
Returns
- RectTransform
Scroll(Transform, string, UiTheme)
public static RectTransform Scroll(Transform parent, string name, UiTheme theme)
Parameters
Returns
- RectTransform
SetFill(Image, float)
public static void SetFill(Image image, float value)
Parameters
imageImagevaluefloat
SetSliced(Image, Sprite)
public static void SetSliced(Image image, Sprite sprite)
Parameters
imageImagespriteSprite
Size(RectTransform, float, float)
public static void Size(RectTransform rect, float width, float height)
Parameters
Slider(Transform, string, UiTheme)
A horizontal 0..1 slider: rounded track, accent fill and a handle that shows the focus colour.
public static Slider Slider(Transform parent, string name, UiTheme theme)
Parameters
Returns
- Slider
Spacer(Transform, bool)
A flexible gap in a row or column.
public static RectTransform Spacer(Transform parent, bool vertical = false)
Parameters
parentTransformverticalbool
Returns
- RectTransform
Stretch(RectTransform, float)
public static void Stretch(RectTransform rect, float inset = 0)
Parameters
rectRectTransforminsetfloat
Surface(Transform, string, UiTheme, Vector2)
A modal or side panel: rounded panel fill, fine border, padded vertical layout.
public static RectTransform Surface(Transform parent, string name, UiTheme theme, Vector2 size)
Parameters
Returns
- RectTransform
Text(Transform, string, string, UiTheme, int)
public static TextMeshProUGUI Text(Transform parent, string name, string key, UiTheme theme, int size = 0)
Parameters
Returns
- TextMeshProUGUI
TextButton(Transform, string, string, UiTheme, UiButtonKind)
public static Button TextButton(Transform parent, string name, string key, UiTheme theme, UiButtonKind kind = UiButtonKind.Primary)
Parameters
parentTransformnamestringkeystringthemeUiThemekindUiButtonKind
Returns
- Button
TextHeight(TextMeshProUGUI, float, bool)
public static void TextHeight(TextMeshProUGUI label, float height, bool flexible = false)
Parameters
Wide(Button, float)
Gives a button a minimum width, for stacked dialog actions of equal size.
public static Button Wide(Button button, float width)
Parameters
buttonButtonwidthfloat
Returns
- Button