Class TAnimCore
Assembly: Febucci.TextAnimator.Runtime.dll
Syntax
public abstract class TAnimCore : MonoBehaviour
Fields
animationLoop
Controls when Text Animator should update its effects. Set it to Script if you want to control the animations from your own loop, invoking the Animate(Single) method.
Declaration
public AnimationLoop animationLoop
Field Value
Controls how default tags should be applied.\n"Fallback" will apply the effects only to characters that don't have any.\n"Constant" will apply the default effects to all the characters, even if they already have other tags via text.
Declaration
public TAnimCore.DefaultTagsMode defaultTagsMode
Field Value
isResettingTimeOnNewText
True if you want the animator's time to be reset on new text.
Declaration
public bool isResettingTimeOnNewText
Field Value
Type |
Description |
System.Boolean |
|
referenceFontSize
Font size that will be used as reference to keep animations consistent/uniform at different scales. Works only if useDynamicScaling is set to true.
Declaration
public float referenceFontSize
Field Value
Type |
Description |
System.Single |
|
time
Contains TextAnimator's current time values.
Declaration
Field Value
timeScale
Chooses which Time Scale to use when automatically animating effects (in other words, when the Update Mode is not set to Script). Set it to Unscaled if you want to animate effects even when the game is paused.
Declaration
public TimeScale timeScale
Field Value
typewriterStartsAutomatically
If the source text changes, should the typewriter start automatically?
Declaration
public bool typewriterStartsAutomatically
Field Value
Type |
Description |
System.Boolean |
|
useDefaultDatabases
True if you want to use the databases referenced in the TextAnimatorSettings asset, otherwise you can specify which databases to use in this component.
Declaration
public bool useDefaultDatabases
Field Value
Type |
Description |
System.Boolean |
|
useDefaultStyleSheet
Declaration
public bool useDefaultStyleSheet
Field Value
Type |
Description |
System.Boolean |
|
useDynamicScaling
True if you want the animations to be uniform/consistent across different font sizes. Default/Suggested to leave this as true, and change referenceFontSize. Otherwise, effects will move more when the text is smaller (requires less space on screen).
Declaration
public bool useDynamicScaling
Field Value
Type |
Description |
System.Boolean |
|
Properties
Actions
All the actions that have been parsed from the current text, and that will be used by a TypewriterCore component if present.
Declaration
public ActionMarker[] Actions { get; set; }
Property Value
true
if the text is entirely visible, including waiting for appearance effects to finish
(as they might still hide a character until the very end)
Declaration
public bool allLettersShown { get; }
Property Value
Type |
Description |
System.Boolean |
|
anyLetterVisible
true
if any letter is still visible in the text
Declaration
public bool anyLetterVisible { get; }
Property Value
Type |
Description |
System.Boolean |
|
Appearances
All the appearance effects that are applied to the current text.
Declaration
public AnimationRegion[] Appearances { get; set; }
Property Value
Behaviors
All the behavior effects that are applied to the current text.
Declaration
public AnimationRegion[] Behaviors { get; set; }
Property Value
Characters
The array of characters currently present in the text.
Declaration
public CharacterData[] Characters { get; }
Property Value
CharactersCount
Declaration
public int CharactersCount { get; }
Property Value
Type |
Description |
System.Int32 |
|
DatabaseActions
Declaration
public ActionDatabase DatabaseActions { get; set; }
Property Value
DatabaseAppearances
Declaration
public AnimationsDatabase DatabaseAppearances { get; set; }
Property Value
DatabaseBehaviors
Declaration
public AnimationsDatabase DatabaseBehaviors { get; set; }
Property Value
Fallback/Constant tags that will be applied to the entire text, if no other tags are found, based on the defaultTagsMode value.
Declaration
public string[] DefaultAppearancesTags { get; set; }
Property Value
Type |
Description |
System.String[] |
|
Fallback/Constant tags that will be applied to the entire text, if no other tags are found, based on the defaultTagsMode value.
Declaration
public string[] DefaultBehaviorsTags { get; set; }
Property Value
Type |
Description |
System.String[] |
|
Fallback/Constant tags that will be applied to the entire text, if no other tags are found, based on the defaultTagsMode value.
Declaration
public string[] DefaultDisappearancesTags { get; set; }
Property Value
Type |
Description |
System.String[] |
|
Disappearances
All the disappearance effects that are applied to the current text.
Declaration
public AnimationRegion[] Disappearances { get; set; }
Property Value
effectIntensityMultiplier
Declaration
public float effectIntensityMultiplier { get; set; }
Property Value
Type |
Description |
System.Single |
|
effectsAppearancesEnabled
Declaration
public static bool effectsAppearancesEnabled { get; }
Property Value
Type |
Description |
System.Boolean |
|
effectsBehaviorsEnabled
Declaration
public static bool effectsBehaviorsEnabled { get; }
Property Value
Type |
Description |
System.Boolean |
|
Events
Events that have been parsed from the current text, and that will be used by a TypewriterCore component if present.
Declaration
public EventMarker[] Events { get; set; }
Property Value
firstVisibleCharacter
Handles the very first character allowed to be visible in the text.
Declaration
public int firstVisibleCharacter { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
isResettingEffectsOnNewText
Declaration
public bool isResettingEffectsOnNewText { get; }
Property Value
Type |
Description |
System.Boolean |
|
latestCharacterShown
Declaration
public CharacterData latestCharacterShown { get; }
Property Value
maxVisibleCharacters
Handles the very last character allowed to be visible in the text.
Declaration
public int maxVisibleCharacters { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
onEvent
Declaration
public MessageEvent onEvent { get; }
Property Value
StyleSheet
Declaration
public StyleSheetScriptable StyleSheet { get; set; }
Property Value
text
Declaration
public string text { get; }
Property Value
Type |
Description |
System.String |
|
textFull
Declaration
public string textFull { get; set; }
Property Value
Type |
Description |
System.String |
|
textWithoutAnyTag
Declaration
public string textWithoutAnyTag { get; }
Property Value
Type |
Description |
System.String |
|
textWithoutTextAnimTags
The text without any Text Animator tag
Declaration
public string textWithoutTextAnimTags { get; }
Property Value
Type |
Description |
System.String |
|
updateMode
Declaration
public AnimationLoop updateMode { get; }
Property Value
Words
The array of words currently present in the text.
Declaration
public WordInfo[] Words { get; }
Property Value
WordsCount
Number of words in the text
Declaration
public int WordsCount { get; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
Animate(Single)
Proceeds the text animation with the given deltaTime value.
Declaration
public void Animate(float deltaTime)
Parameters
Type |
Name |
Description |
System.Single |
deltaTime |
|
Examples
You could use this if animationLoop is set to Script and you want to control when to animate the text.
AppendText(String, Boolean)
Adds text to the already existing one, parsing its rich text tags.
Declaration
public void AppendText(string appendedText, bool hideText = false)
Parameters
Type |
Name |
Description |
System.String |
appendedText |
New text that you want to append
|
System.Boolean |
hideText |
|
CopyMeshFromSource(ref CharacterData[])
Declaration
protected abstract void CopyMeshFromSource(ref CharacterData[] characters)
Parameters
EnableAllEffects(Boolean)
Declaration
public static void EnableAllEffects(bool enabled)
Parameters
Type |
Name |
Description |
System.Boolean |
enabled |
|
EnableAppearances(Boolean)
Declaration
public static void EnableAppearances(bool enabled)
Parameters
Type |
Name |
Description |
System.Boolean |
enabled |
|
EnableAppearancesLocally(Boolean)
Declaration
public void EnableAppearancesLocally(bool value)
Parameters
Type |
Name |
Description |
System.Boolean |
value |
|
EnableBehaviors(Boolean)
Declaration
public static void EnableBehaviors(bool enabled)
Parameters
Type |
Name |
Description |
System.Boolean |
enabled |
|
EnableBehaviorsLocally(Boolean)
Declaration
public void EnableBehaviorsLocally(bool value)
Parameters
Type |
Name |
Description |
System.Boolean |
value |
|
ForceDatabaseRefresh()
Declaration
public void ForceDatabaseRefresh()
ForceMeshRefresh()
Declaration
public void ForceMeshRefresh()
GetCharactersCount()
Declaration
protected abstract int GetCharactersCount()
Returns
Type |
Description |
System.Int32 |
|
Declaration
protected virtual TagParserBase[] GetExtraParsers()
Returns
GetFirstCharacterIndexInsidePage()
Returns the first character index inside the page, in case the text has an overflow mode set up and the text is paginated.
Declaration
public virtual int GetFirstCharacterIndexInsidePage()
Returns
Type |
Description |
System.Int32 |
|
Examples
If each page has 5 characters, and we're on page 2, then this method would return 5 as the starting index of the text.
GetOriginalTextFromSource()
Declaration
public abstract string GetOriginalTextFromSource()
Returns
Type |
Description |
System.String |
|
GetRenderedCharactersCountInsidePage()
Returns the number of characters that fit inside the page, in case the text has an overflow mode set up and the text is paginated. (otherwise simply returns the characters count)
Declaration
public virtual int GetRenderedCharactersCountInsidePage()
Returns
Type |
Description |
System.Int32 |
|
GetStrippedTextFromSource()
Declaration
public abstract string GetStrippedTextFromSource()
Returns
Type |
Description |
System.String |
|
HasChangedRenderingSettings()
Declaration
protected abstract bool HasChangedRenderingSettings()
Returns
Type |
Description |
System.Boolean |
|
HasChangedText(String)
Declaration
protected abstract bool HasChangedText(string strippedText)
Parameters
Type |
Name |
Description |
System.String |
strippedText |
|
Returns
Type |
Description |
System.Boolean |
|
IsReady()
Declaration
protected abstract bool IsReady()
Returns
Type |
Description |
System.Boolean |
|
OnEnable()
Declaration
protected virtual void OnEnable()
OnForceMeshUpdate()
Declaration
protected abstract void OnForceMeshUpdate()
OnInitialized()
Called once when the component is initialized.
Declaration
protected virtual void OnInitialized()
PasteMeshToSource(CharacterData[])
Declaration
protected abstract void PasteMeshToSource(CharacterData[] characters)
Parameters
ResetEffectsTime(Boolean)
Declaration
public void ResetEffectsTime(bool skipAppearances)
Parameters
Type |
Name |
Description |
System.Boolean |
skipAppearances |
|
ResetState()
Declaration
ScheduleMeshRefresh()
Schedules that a mesh refresh is required as soon as possible, which will be applied before the next animation loop starts.
Declaration
public void ScheduleMeshRefresh()
SetAppearancesActive(Boolean)
Enables or disables appearance effects animation LOCALLY on this Text Animator component.
To change this globally, see SetAppearancesActive(Boolean)
Declaration
public void SetAppearancesActive(bool isCategoryEnabled)
Parameters
Type |
Name |
Description |
System.Boolean |
isCategoryEnabled |
|
SetBehaviorsActive(Boolean)
Enables or disables behavior effects animation LOCALLY on this Text Animator component.
To change this globally, see SetBehaviorsActive(Boolean)
Declaration
public void SetBehaviorsActive(bool isCategoryEnabled)
Parameters
Type |
Name |
Description |
System.Boolean |
isCategoryEnabled |
|
SetText(String)
Sets the text to Text Animator, parsing its rich text tags.
Declaration
public void SetText(string text)
Parameters
Type |
Name |
Description |
System.String |
text |
Full text that you want to paste, including rich text tags.
|
SetText(String, Boolean)
Sets the text to Text Animator, parsing its rich text tags.
Declaration
public void SetText(string text, bool hideText)
Parameters
Type |
Name |
Description |
System.String |
text |
|
System.Boolean |
hideText |
|
SetTextToSource(String)
Declaration
public abstract void SetTextToSource(string text)
Parameters
Type |
Name |
Description |
System.String |
text |
|
SetVisibilityChar(Int32, Boolean, Boolean)
Sets a character visibility.
Declaration
public void SetVisibilityChar(int index, bool isVisible, bool canPlayEffects = true)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
Character's index. See CharactersCount and the Characters array.
|
System.Boolean |
isVisible |
Controls if the character should be visible
|
System.Boolean |
canPlayEffects |
|
SetVisibilityEntireText(Boolean, Boolean)
Sets the visibility of the entire text, also allowing to play or skip effects.
Declaration
public void SetVisibilityEntireText(bool isVisible, bool canPlayEffects = true)
Parameters
Type |
Name |
Description |
System.Boolean |
isVisible |
|
System.Boolean |
canPlayEffects |
|
SetVisibilityWord(Int32, Boolean, Boolean)
Declaration
public void SetVisibilityWord(int index, bool isVisible, bool canPlayEffects = true)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
Word's index. See WordsCount and the Words array.
|
System.Boolean |
isVisible |
Controls if the word should be visible
|
System.Boolean |
canPlayEffects |
|
ShowAllCharacters(Boolean)
Turns all characters visible at the end of the frame (i.e. "a typewriter skip")
Declaration
public void ShowAllCharacters(bool skipAppearanceEffects)
Parameters
Type |
Name |
Description |
System.Boolean |
skipAppearanceEffects |
Set this to true if you want all letters to appear instantly (without any appearance effect)
|
SwapText(String)
Changes the text to Text Animator with a new one, keeping the current visibility
Declaration
public void SwapText(string text)
Parameters
Type |
Name |
Description |
System.String |
text |
|
TriggerRemainingEvents()
Declaration
public void TriggerRemainingEvents()
TriggerVisibleEvents()
Declaration
public void TriggerVisibleEvents()
UpdateEffects()
Declaration
public void UpdateEffects()