CanvasTmpTextRenderer
public class CanvasTmpTextRenderer : IChartTextRendererCanvas text renderer implementation using TextMeshPro.
Properties
Section titled “Properties”
GameObject
Section titled “GameObject”public GameObject GameObject { get; }The underlying GameObject containing the text component.
Returns
UnityEngine.GameObject — No return description is available.
RectTransform
Section titled “RectTransform”public RectTransform RectTransform { get; }The RectTransform of the text component.
Returns
UnityEngine.RectTransform — No return description is available.
public string Text { get; set; }Gets or sets the text content.
Returns
System.String — No return description is available.
FontSize
Section titled “FontSize”public float FontSize { get; set; }Gets or sets the font size.
Returns
System.Single — No return description is available.
public Color Color { get; set; }Gets or sets the text color.
Returns
UnityEngine.Color — No return description is available.
Alignment
Section titled “Alignment”public ChartTextAlignment Alignment { get; set; }Gets or sets the text alignment.
Returns
ChartGuru.ChartTextAlignment — No return description is available.
IsActive
Section titled “IsActive”public bool IsActive { get; set; }Gets or sets whether the text is active/visible.
Returns
System.Boolean — No return description is available.
IsValid
Section titled “IsValid”public bool IsValid { get; }Returns true if the underlying GameObject is still valid (not destroyed).
Returns
System.Boolean — No return description is available.
Constructors
Section titled “Constructors”
CanvasTmpTextRenderer(string, Transform)
Section titled “CanvasTmpTextRenderer(string, Transform)”public CanvasTmpTextRenderer(string name, Transform parent = null)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
name |
System.String | |
parent |
UnityEngine.Transform | |
CanvasTmpTextRenderer(TextMeshProUGUI)
Section titled “CanvasTmpTextRenderer(TextMeshProUGUI)”public CanvasTmpTextRenderer(TextMeshProUGUI existingText)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
existingText |
TMPro.TextMeshProUGUI |
Methods
Section titled “Methods”
SetParent(Transform, bool)
Section titled “SetParent(Transform, bool)”public void SetParent(Transform parent, bool worldPositionStays = false)Sets the parent transform for this text renderer.
Parameters
| Name | Type | Description |
|---|---|---|
parent |
UnityEngine.Transform | |
worldPositionStays |
System.Boolean | |
SetPosition(Vector2)
Section titled “SetPosition(Vector2)”public void SetPosition(Vector2 position)Sets the anchored position within the parent RectTransform.
Parameters
| Name | Type | Description |
|---|---|---|
position |
UnityEngine.Vector2 | |
SetRotation(float)
Section titled “SetRotation(float)”public void SetRotation(float angleDegrees)Sets the local rotation of the text.
Parameters
| Name | Type | Description |
|---|---|---|
angleDegrees |
System.Single | |
SetAnchor(Vector2, Vector2)
Section titled “SetAnchor(Vector2, Vector2)”public void SetAnchor(Vector2 anchorMin, Vector2 anchorMax)Sets the anchor preset for positioning.
Parameters
| Name | Type | Description |
|---|---|---|
anchorMin |
UnityEngine.Vector2 | |
anchorMax |
UnityEngine.Vector2 | |
SetPivot(Vector2)
Section titled “SetPivot(Vector2)”public void SetPivot(Vector2 pivot)Sets the pivot point for rotation and positioning.
Parameters
| Name | Type | Description |
|---|---|---|
pivot |
UnityEngine.Vector2 | |
ApplyOptions(ChartTextOptions)
Section titled “ApplyOptions(ChartTextOptions)”public void ApplyOptions(ChartTextOptions options)Applies text options from configuration.
Parameters
| Name | Type | Description |
|---|---|---|
options |
ChartGuru.ChartTextOptions | |
GetPreferredSize()
Section titled “GetPreferredSize()”public Vector2 GetPreferredSize()Gets the preferred size of the text based on current content and settings.
Returns
UnityEngine.Vector2 — No return description is available.
GetPreferredWidth(string)
Section titled “GetPreferredWidth(string)”public float GetPreferredWidth(string text)Gets the preferred width for a given string without changing the current text.
Parameters
| Name | Type | Description |
|---|---|---|
text |
System.String |
Returns
System.Single — No return description is available.
Destroy()
Section titled “Destroy()”public void Destroy()Destroys the underlying GameObject.