TextStudioApi
public static class TextStudioApiPublic convenience API for common TextStudio operations. Wraps the hub with simple methods so callers can drive reveal without poking at the full TextStudio.TextStudioText surface area.
Methods
Section titled “Methods”
SetNumber(ITextStudioContent, double)
Section titled “SetNumber(ITextStudioContent, double)”public static void SetNumber(ITextStudioContent content, double value)Format a number with the shared default and assign it through the content contract.
Parameters
| Name | Type |
|---|---|
content |
TextStudio.ITextStudioContent |
value |
System.Double |
SetNumber(ITextStudioContent, double, TextStudioNumberFormat)
Section titled “SetNumber(ITextStudioContent, double, TextStudioNumberFormat)”public static void SetNumber(ITextStudioContent content, double value, TextStudioNumberFormat format)Format a number once and assign it to any Text Studio content host.
Parameters
| Name | Type |
|---|---|
content |
TextStudio.ITextStudioContent |
value |
System.Double |
format |
TextStudio.TextStudioNumberFormat |
ShowText(TextStudioText, string, bool)
Section titled “ShowText(TextStudioText, string, bool)”public static void ShowText(TextStudioText hub, string text, bool autoReveal = true)Set text on a TextStudio hub and optionally start reveal.
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
text |
System.String |
autoReveal |
System.Boolean |
SetTextInstant(TextStudioText, string)
Section titled “SetTextInstant(TextStudioText, string)”public static void SetTextInstant(TextStudioText hub, string text)Set text and immediately reveal it (no typewriter animation).
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
text |
System.String |
ConfigureReveal(TextStudioText, RevealMode, float, bool, float)
Section titled “ConfigureReveal(TextStudioText, RevealMode, float, bool, float)”public static void ConfigureReveal(TextStudioText hub, RevealMode revealMode, float speedMultiplier = 1, bool loop = false, float loopDelay = 0.75)Configure reveal playback in one call.
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
revealMode |
TextStudio.RevealMode |
speedMultiplier |
System.Single |
loop |
System.Boolean |
loopDelay |
System.Single |
ConfigurePlacement(TextStudioText, PlacementMode)
Section titled “ConfigurePlacement(TextStudioText, PlacementMode)”public static void ConfigurePlacement(TextStudioText hub, PlacementMode placementMode)Set the active placement mode and mark placement state dirty.
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
placementMode |
TextStudio.PlacementMode |
GetRevealSnapshot(TextStudioText)
Section titled “GetRevealSnapshot(TextStudioText)”public static TextStudioRevealDebugSnapshot GetRevealSnapshot(TextStudioText hub)Return a reveal/debug snapshot suitable for runtime UI or tests.
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
Returns
TextStudio.TextStudioRevealDebugSnapshot
SetGlyphVisibility(TextStudioText, int, bool, bool)
Section titled “SetGlyphVisibility(TextStudioText, int, bool, bool)”public static bool SetGlyphVisibility(TextStudioText hub, int glyphIndex, bool visible, bool playTransition = true)Override one glyph’s visibility without changing typewriter progress.
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
glyphIndex |
System.Int32 |
visible |
System.Boolean |
playTransition |
System.Boolean |
Returns
System.Boolean
SetWordVisibility(TextStudioText, int, bool, bool)
Section titled “SetWordVisibility(TextStudioText, int, bool, bool)”public static bool SetWordVisibility(TextStudioText hub, int wordIndex, bool visible, bool playTransition = true)Override one compiled word’s visibility without changing typewriter progress.
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
wordIndex |
System.Int32 |
visible |
System.Boolean |
playTransition |
System.Boolean |
Returns
System.Boolean
SetTextVisibility(TextStudioText, bool, bool)
Section titled “SetTextVisibility(TextStudioText, bool, bool)”public static bool SetTextVisibility(TextStudioText hub, bool visible, bool playTransition = true)Override every glyph’s visibility while retaining the current reveal state.
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
visible |
System.Boolean |
playTransition |
System.Boolean |
Returns
System.Boolean
ClearGlyphVisibilityOverride(TextStudioText, int)
Section titled “ClearGlyphVisibilityOverride(TextStudioText, int)”public static bool ClearGlyphVisibilityOverride(TextStudioText hub, int glyphIndex)Return one glyph to normal reveal-owned visibility.
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
glyphIndex |
System.Int32 |
Returns
System.Boolean
ClearVisibilityOverrides(TextStudioText)
Section titled “ClearVisibilityOverrides(TextStudioText)”public static bool ClearVisibilityOverrides(TextStudioText hub)Return all glyphs to normal reveal-owned visibility.
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
Returns
System.Boolean
ConfigureEffectFamilies(TextStudioText, bool, bool, bool)
Section titled “ConfigureEffectFamilies(TextStudioText, bool, bool, bool)”public static void ConfigureEffectFamilies(TextStudioText hub, bool reveal, bool active, bool hide)Enable or disable Reveal, Active, and Hide effect families independently.
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
reveal |
System.Boolean |
active |
System.Boolean |
hide |
System.Boolean |
RestartEffects(TextStudioText)
Section titled “RestartEffects(TextStudioText)”public static void RestartEffects(TextStudioText hub)Restart effect time and state without changing text or reveal progress.
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
RefreshEffectBindings(TextStudioText)
Section titled “RefreshEffectBindings(TextStudioText)”public static void RefreshEffectBindings(TextStudioText hub)Re-resolve effect bindings after runtime effect registrations change.
Parameters
| Name | Type |
|---|---|
hub |
TextStudio.TextStudioText |
GetOrAddHub(GameObject)
Section titled “GetOrAddHub(GameObject)”public static TextStudioText GetOrAddHub(GameObject go)Find a TextStudio hub on a GameObject, or add one.
Parameters
| Name | Type |
|---|---|
go |
UnityEngine.GameObject |
Returns
TextStudio.TextStudioText