IChartTextRenderer
public interface IChartTextRendererCanvas label renderer used by Chart Guru’s uGUI surface.
Methods
Section titled “Methods”
SetParent(Transform, bool)
Section titled “SetParent(Transform, bool)”void SetParent(Transform parent, bool worldPositionStays = false)Sets the parent transform for this text renderer.
Parameters
| Name | Type |
|---|---|
parent |
UnityEngine.Transform |
worldPositionStays |
System.Boolean |
SetPosition(Vector2)
Section titled “SetPosition(Vector2)”void SetPosition(Vector2 position)Sets the anchored position within the parent RectTransform.
Parameters
| Name | Type |
|---|---|
position |
UnityEngine.Vector2 |
SetRotation(float)
Section titled “SetRotation(float)”void SetRotation(float angleDegrees)Sets the local rotation of the text.
Parameters
| Name | Type |
|---|---|
angleDegrees |
System.Single |
SetAnchor(Vector2, Vector2)
Section titled “SetAnchor(Vector2, Vector2)”void SetAnchor(Vector2 anchorMin, Vector2 anchorMax)Sets the anchor preset for positioning.
Parameters
| Name | Type |
|---|---|
anchorMin |
UnityEngine.Vector2 |
anchorMax |
UnityEngine.Vector2 |
SetPivot(Vector2)
Section titled “SetPivot(Vector2)”void SetPivot(Vector2 pivot)Sets the pivot point for rotation and positioning.
Parameters
| Name | Type |
|---|---|
pivot |
UnityEngine.Vector2 |
ApplyOptions(ChartTextOptions)
Section titled “ApplyOptions(ChartTextOptions)”void ApplyOptions(ChartTextOptions options)Applies text options from configuration.
Parameters
| Name | Type |
|---|---|
options |
ChartGuru.ChartTextOptions |
GetPreferredSize()
Section titled “GetPreferredSize()”Vector2 GetPreferredSize()Gets the preferred size of the text based on current content and settings.
Returns
UnityEngine.Vector2
GetPreferredWidth(string)
Section titled “GetPreferredWidth(string)”float GetPreferredWidth(string text)Gets the preferred width for a given string without changing the current text.
Parameters
| Name | Type |
|---|---|
text |
System.String |
Returns
System.Single
Destroy()
Section titled “Destroy()”void Destroy()Destroys the underlying GameObject.
Properties
Section titled “Properties”
GameObject
Section titled “GameObject”GameObject GameObject { get; }The underlying GameObject containing the text component.
Returns
UnityEngine.GameObject
RectTransform
Section titled “RectTransform”RectTransform RectTransform { get; }The RectTransform of the text component.
Returns
UnityEngine.RectTransform
string Text { get; set; }Gets or sets the text content.
Returns
System.String
FontSize
Section titled “FontSize”float FontSize { get; set; }Gets or sets the font size.
Returns
System.Single
Color Color { get; set; }Gets or sets the text color.
Returns
UnityEngine.Color
Alignment
Section titled “Alignment”ChartTextAlignment Alignment { get; set; }Gets or sets the text alignment.
Returns
ChartGuru.ChartTextAlignment
IsActive
Section titled “IsActive”bool IsActive { get; set; }Gets or sets whether the text is active/visible.
Returns
System.Boolean
IsValid
Section titled “IsValid”bool IsValid { get; }Returns true if the underlying GameObject is still valid (not destroyed).
Returns
System.Boolean