Show / Hide Table of Contents

Class TypewriterCore

Base class for all TextAnimatorPlayers (typewriters).

  • Manual: TextAnimatorPlayers.
Inheritance
Object
TypewriterCore
TypewriterByCharacter
TypewriterByWord
Namespace: Febucci.UI.Core
Assembly: Febucci.TextAnimator.Runtime.dll
Syntax
public abstract class TypewriterCore : MonoBehaviour
Remarks

If you want to use the default TextAnimatorPlayer, see: TypewriterByCharacter

You can also create custom typewriters by inheriting from this class.
Manual: Writing Custom TextAnimatorPlayers (C#)

Fields

disappearanceOrientation

Declaration
public TypewriterCore.DisappearanceOrientation disappearanceOrientation
Field Value
Type Description
TypewriterCore.DisappearanceOrientation

onCharacterVisible

Called once a character has been shown by the typewriter.
It is only invoked when the typewriter is enabled.

Declaration
public CharacterEvent onCharacterVisible
Field Value
Type Description
CharacterEvent

onMessage

Declaration
public MessageEvent onMessage
Field Value
Type Description
MessageEvent

onTextDisappeared

Callend once the typewriter has completed hiding all the letters.

Declaration
public UnityEvent onTextDisappeared
Field Value
Type Description
UnityEvent

onTextShowed

Called once the text is completely shown.
If the typewriter is enabled, this event is called once it has ended showing all letters.

Declaration
public UnityEvent onTextShowed
Field Value
Type Description
UnityEvent

onTypewriterStart

Called once the typewriter starts showing text.
It is only invoked when the typewriter is enabled.

Declaration
public UnityEvent onTypewriterStart
Field Value
Type Description
UnityEvent

startTypewriterMode

Declaration
public TypewriterCore.StartTypewriterMode startTypewriterMode
Field Value
Type Description
TypewriterCore.StartTypewriterMode

useTypeWriter

true if the typewriter is enabled

Declaration
public bool useTypeWriter
Field Value
Type Description
Boolean

Properties

isBaseInsideRoutine

Declaration
protected bool isBaseInsideRoutine { get; }
Property Value
Type Description
Boolean

isHidingText

Declaration
public bool isHidingText { get; }
Property Value
Type Description
Boolean

isShowingText

Declaration
public bool isShowingText { get; }
Property Value
Type Description
Boolean

textAnimator

Declaration
public TAnimCore textAnimator { get; }
Property Value
Type Description
TAnimCore

TextAnimator

The TextAnimator Component linked to this typewriter

Declaration
public TAnimCore TextAnimator { get; }
Property Value
Type Description
TAnimCore

typewriterPlayerSpeed

Declaration
protected float typewriterPlayerSpeed { get; set; }
Property Value
Type Description
Single

wantsToSkip

Declaration
protected bool wantsToSkip { get; set; }
Property Value
Type Description
Boolean

Methods

GetWaitAppearanceTimeOf(Int32)

Declaration
protected abstract float GetWaitAppearanceTimeOf(int charIndex)
Parameters
Type Name Description
Int32 charIndex
Returns
Type Description
Single

GetWaitDisappearanceTimeOf(Int32)

Declaration
protected virtual float GetWaitDisappearanceTimeOf(int charIndex)
Parameters
Type Name Description
Int32 charIndex
Returns
Type Description
Single

OnDisable()

Unity's default MonoBehavior 'OnDisable' callback.

Declaration
protected virtual void OnDisable()
Remarks

P.S. If you're overriding this method, don't forget to invoke the base one.

OnEnable()

Unity's default MonoBehavior 'OnEnable' callback.

Declaration
protected virtual void OnEnable()
Remarks

P.S. If you're overriding this method, don't forget to invoke the base one.

SetTypewriterSpeed(Single)

Makes the typewriter slower/faster, by setting its internal speed multiplier.

Declaration
public void SetTypewriterSpeed(float value)
Parameters
Type Name Description
Single value
Remarks

The minimum value is 0.001

Examples

If the typewriter has to wait 1 second to show the next letter but you set the typewriter speed to 2, the typewriter will wait 0.5 seconds.

ShowText(String)

Sets the given text to the connected TextAnimator component.
If enabled, it also starts showing letters dynamically.

  • Manual: Text Animator Players
Declaration
public void ShowText(string text)
Parameters
Type Name Description
String text
Remarks

If the typewriter is enabled but its start mode (editable in the Inspector) doesn't include OnShowText, this method won't start showing letters. You'd have to manually call StartShowingText(Boolean) in order to start the typewriter, or include different "start modes" like OnEnable and let the script manage it automatically.

SkipTypewriter()

Skips the typewriter animation (if it's currently showing).
In case the text is revealing, it will show all the letters immediately.
In case the text is hiding, it will hide all the letters immediately.

Declaration
public void SkipTypewriter()
Remarks

If both revealing and hiding are occurring, hiding will prevail.

StartDisappearingText()

Starts disappearing the text dynamically

Declaration
public void StartDisappearingText()

StartShowingText(Boolean)

Starts showing letters dynamically

Declaration
public void StartShowingText(bool restart = false)
Parameters
Type Name Description
Boolean restart
false
if you want the typewriter to resume where it was left.
true
if the typewriter should restart from character 0

StopDisappearingText()

Stops the typewriter's from disappearing the text dynamically, leaving the text at its current state

Declaration
public void StopDisappearingText()

StopShowingText()

Stops showing letters dynamically, leaving the text as it is.

Declaration
public void StopShowingText()

TriggerRemainingEvents()

Declaration
public void TriggerRemainingEvents()

TriggerVisibleEvents()

Declaration
public void TriggerVisibleEvents()
Back to top Text Animator for Unity - Documentation