CanvasTextPool
public class CanvasTextPoolCanvas TextMeshPro label pools organized by text category.
Constructors
Section titled “Constructors”
CanvasTextPool(Transform, ChartTheme, int, int)
Section titled “CanvasTextPool(Transform, ChartTheme, int, int)”public CanvasTextPool(Transform parent, ChartTheme theme = null, int defaultCapacity = 10, int maxSize = 100)Creates a new Canvas TMP label pool.
Parameters
| Name | Type | Description |
|---|---|---|
parent |
UnityEngine.Transform | Parent transform for all pooled text objects. |
theme |
ChartGuru.ChartTheme | Optional theme for default styling. |
defaultCapacity |
System.Int32 | Initial capacity for each category pool. |
maxSize |
System.Int32 | Maximum pool size per category before items are destroyed. |
Methods
Section titled “Methods”
Acquire(TextCategory)
Section titled “Acquire(TextCategory)”public IChartTextRenderer Acquire(TextCategory category)Acquires a text renderer from the pool for the specified category.
Parameters
| Name | Type | Description |
|---|---|---|
category |
ChartGuru.TextCategory | The text category determining default styling. |
Returns
ChartGuru.IChartTextRenderer — A text renderer, either from the pool or newly created.
Acquire(TextCategory, string)
Section titled “Acquire(TextCategory, string)”public IChartTextRenderer Acquire(TextCategory category, string text)Acquires a text renderer and sets its text content.
Parameters
| Name | Type | Description |
|---|---|---|
category |
ChartGuru.TextCategory | |
text |
System.String |
Returns
ChartGuru.IChartTextRenderer — No return description is available.
Acquire(TextCategory, string, Vector2)
Section titled “Acquire(TextCategory, string, Vector2)”public IChartTextRenderer Acquire(TextCategory category, string text, Vector2 position)Acquires a text renderer with text and position.
Parameters
| Name | Type | Description |
|---|---|---|
category |
ChartGuru.TextCategory | |
text |
System.String | |
position |
UnityEngine.Vector2 |
Returns
ChartGuru.IChartTextRenderer — No return description is available.
Release(IChartTextRenderer, TextCategory)
Section titled “Release(IChartTextRenderer, TextCategory)”public void Release(IChartTextRenderer renderer, TextCategory category)Returns a text renderer to its pool.
Parameters
| Name | Type | Description |
|---|---|---|
renderer |
ChartGuru.IChartTextRenderer | The renderer to release. |
category |
ChartGuru.TextCategory | The category pool to return it to. |
ReleaseAll(List, TextCategory)
Section titled “ReleaseAll(List, TextCategory)”public void ReleaseAll(List<IChartTextRenderer> renderers, TextCategory category)Returns all active renderers in a list to their pool.
Parameters
| Name | Type | Description |
|---|---|---|
renderers |
System.Collections.Generic.List{ChartGuru.IChartTextRenderer} | |
category |
ChartGuru.TextCategory | |
Clear()
Section titled “Clear()”public void Clear()Clears all pools, destroying all pooled objects. Call this when the chart is destroyed.
Clear(TextCategory)
Section titled “Clear(TextCategory)”public void Clear(TextCategory category)Clears a specific category pool.
Parameters
| Name | Type | Description |
|---|---|---|
category |
ChartGuru.TextCategory | |
GetInactiveCount(TextCategory)
Section titled “GetInactiveCount(TextCategory)”public int GetInactiveCount(TextCategory category)Gets the count of inactive (available) renderers in a category.
Parameters
| Name | Type | Description |
|---|---|---|
category |
ChartGuru.TextCategory |
Returns
System.Int32 — No return description is available.
GetTotalCount(TextCategory)
Section titled “GetTotalCount(TextCategory)”public int GetTotalCount(TextCategory category)Gets the total count (active + inactive) in a category.
Parameters
| Name | Type | Description |
|---|---|---|
category |
ChartGuru.TextCategory |
Returns
System.Int32 — No return description is available.
Dispose()
Section titled “Dispose()”public void Dispose()No description is available for this member.