Class CampaignUi
- Namespace
- TDMaker.Unity.Campaign
- Assembly
- TDMaker.Unity.dll
Helpers shared by the campaign screens (built from code with a HudTheme, like the HUD).
public static class CampaignUi
- Inheritance
-
CampaignUi
- Inherited Members
Properties
Texts
The current text resolver.
public static TextResolver Texts { get; }
Property Value
Methods
Canvas(string, Transform, HudTheme, int)
Creates a screen-space overlay canvas scaled like the HUD (for screens used outside an existing canvas).
public static RectTransform Canvas(string name, Transform parent, HudTheme theme, int sortingOffset = 20)
Parameters
Returns
- RectTransform
Chip(string, Transform, HudTheme)
A small value plate (star totals, counters): the theme's tooltip plate with its trim when the theme has one, otherwise the panel sprite. Small enough plates should not use a decorative panel frame, whose borders need more room.
public static Image Chip(string name, Transform parent, HudTheme theme)
Parameters
Returns
- Image
DestroyObject(GameObject)
Destroys a UI object (immediately outside play mode, where deferred destruction is not allowed).
public static void DestroyObject(GameObject go)
Parameters
goGameObject
LevelSummary(CampaignLevel)
Summary of a campaign level in the current language (campaign.level.<key>.summary, then the entry).
public static string LevelSummary(CampaignLevel level)
Parameters
levelCampaignLevel
Returns
LevelTitle(CampaignLevel)
Title of a campaign level in the current language (campaign.level.<key>.title, then the entry, then the level asset).
public static string LevelTitle(CampaignLevel level)
Parameters
levelCampaignLevel
Returns
Paragraph(string, Transform, HudTheme, float, Color, TextAnchor, string)
A wrapping label.
public static TextMeshProUGUI Paragraph(string name, Transform parent, HudTheme theme, float size, Color color, TextAnchor anchor, string text = "")
Parameters
Returns
- TextMeshProUGUI
TextButton(Transform, HudTheme, string, string, Vector2, Vector2, Action)
A themed text button centred at position of its parent.
public static HudButton TextButton(Transform parent, HudTheme theme, string name, string text, Vector2 position, Vector2 size, Action action)