Table of Contents
ModHelperComponent for a background panel
public class ModHelperText : BTD_Mod_Helper.Api.Components.ModHelperComponent
Inheritance UnityEngine.MonoBehaviour ModHelperComponent ModHelperText
Makes the width of this object scale with the text its holding
public bool SizingWidthToText { get; set; }
The component that handles the Text rendering
public NK_TextMeshProUGUI Text { get; }
Creates a new ModHelperText
public static BTD_Mod_Helper.Api.Components.ModHelperText Create(BTD_Mod_Helper.Api.Components.Info info, string text, float fontSize=42f, TextAlignmentOptions align=4098);
info
Info
The name/position/size info
text
System.String
The text to display
fontSize
System.Single
Size of font
align
Il2CppTMPro.TextAlignmentOptions
Alignment of text
ModHelperText
The created ModHelperText
Enables auto sizing for this Text component
public void EnableAutoSizing();
Enables or disables auto sizing for this Text component
public void EnableAutoSizing(bool enable);
enable
System.Boolean
Enables auto sizing for Text
public void EnableAutoSizing(float fontSizeMax, float fontSizeMin);
fontSizeMax
System.Single
fontSizeMin
System.Single
Enables auto sizing for this Text component
public void EnableAutoSizing(float fontSizeMax);
fontSizeMax
System.Single
Unity Component OnUpdate
protected override void OnUpdate();
Sets the text of this text to the given text
public void SetText(string text);
text
System.String
Makes the width of this object scale with the text its holding
public void SizeWidthToText(bool sizeWidthToText=true);
sizeWidthToText
System.Boolean