PixelCrushers.DialogueSystem.UnityUITypewriterEffect Class Reference

This is a typewriter effect for Unity UI. More...

Inheritance diagram for PixelCrushers.DialogueSystem.UnityUITypewriterEffect:
Collaboration diagram for PixelCrushers.DialogueSystem.UnityUITypewriterEffect:

Classes

class  AutoScrollSettings
 

Public Member Functions

void Awake ()
 
void Start ()
 
void OnEnable ()
 
void OnDisable ()
 
void Pause ()
 Pauses the effect. More...
 
void Unpause ()
 Unpauses the effect. More...
 
void PlayText (string text)
 Play typewriter on text immediately. More...
 
IEnumerator Play ()
 Plays the typewriter effect. More...
 
void Stop ()
 Stops the effect. More...
 

Static Public Member Functions

static string StripRPGMakerCodes (string s)
 

Public Attributes

bool rightToLeft = false
 Set true to type right to left. More...
 
float charactersPerSecond = 50
 How fast to "type." More...
 
AudioClip audioClip = null
 The audio clip to play with each character. More...
 
AudioClip[] alternateAudioClips = new AudioClip[0]
 If specified, randomly use these clips or the main Audio Clip. More...
 
AudioSource audioSource = null
 The audio source through which to play the clip. More...
 
bool interruptAudioClip = false
 If audio clip is still playing from previous character, stop and restart it when typing next character. More...
 
string silentCharacters = string.Empty
 Don't play audio on these characters. More...
 
float fullPauseDuration = 1f
 Duration to pause on when text contains '\. More...
 
float quarterPauseDuration = 0.25f
 Duration to pause when text contains '\,' More...
 
bool removeDuplicateTypewriterEffects = true
 Ensures this GameObject has only one typewriter effect. More...
 
bool playOnEnable = true
 Play using the current text content whenever component is enabled. More...
 
bool waitOneFrameBeforeStarting = false
 Wait one frame to allow layout elements to setup first. More...
 
AutoScrollSettings autoScrollSettings = new AutoScrollSettings()
 Optional auto-scroll settings. More...
 
UnityEvent onBegin = new UnityEvent()
 
UnityEvent onCharacter = new UnityEvent()
 
UnityEvent onEnd = new UnityEvent()
 

Properties

bool IsPlaying [get]
 Indicates whether the effect is playing. More...
 

Detailed Description

This is a typewriter effect for Unity UI.

It handles bold, italic, quad, and color rich text tags and certain RPGMaker-style tags. It also works with any text alignment.

Member Function Documentation

◆ Awake()

void PixelCrushers.DialogueSystem.UnityUITypewriterEffect.Awake ( )

◆ OnDisable()

void PixelCrushers.DialogueSystem.UnityUITypewriterEffect.OnDisable ( )

◆ OnEnable()

void PixelCrushers.DialogueSystem.UnityUITypewriterEffect.OnEnable ( )

◆ Pause()

void PixelCrushers.DialogueSystem.UnityUITypewriterEffect.Pause ( )

Pauses the effect.

◆ Play()

IEnumerator PixelCrushers.DialogueSystem.UnityUITypewriterEffect.Play ( )

Plays the typewriter effect.

◆ PlayText()

void PixelCrushers.DialogueSystem.UnityUITypewriterEffect.PlayText ( string  text)

Play typewriter on text immediately.

Parameters
text

◆ Start()

void PixelCrushers.DialogueSystem.UnityUITypewriterEffect.Start ( )

◆ Stop()

void PixelCrushers.DialogueSystem.UnityUITypewriterEffect.Stop ( )

Stops the effect.

◆ StripRPGMakerCodes()

static string PixelCrushers.DialogueSystem.UnityUITypewriterEffect.StripRPGMakerCodes ( string  s)
static

◆ Unpause()

void PixelCrushers.DialogueSystem.UnityUITypewriterEffect.Unpause ( )

Unpauses the effect.

The text will resume at the point where it was paused; it won't try to catch up to make up for the pause.

Member Data Documentation

◆ alternateAudioClips

AudioClip [] PixelCrushers.DialogueSystem.UnityUITypewriterEffect.alternateAudioClips = new AudioClip[0]

If specified, randomly use these clips or the main Audio Clip.

◆ audioClip

AudioClip PixelCrushers.DialogueSystem.UnityUITypewriterEffect.audioClip = null

The audio clip to play with each character.

◆ audioSource

AudioSource PixelCrushers.DialogueSystem.UnityUITypewriterEffect.audioSource = null

The audio source through which to play the clip.

If unassigned, will look for an audio source on this GameObject.

◆ autoScrollSettings

AutoScrollSettings PixelCrushers.DialogueSystem.UnityUITypewriterEffect.autoScrollSettings = new AutoScrollSettings()

Optional auto-scroll settings.

◆ charactersPerSecond

float PixelCrushers.DialogueSystem.UnityUITypewriterEffect.charactersPerSecond = 50

How fast to "type."

◆ fullPauseDuration

float PixelCrushers.DialogueSystem.UnityUITypewriterEffect.fullPauseDuration = 1f

Duration to pause on when text contains '\.

'

◆ interruptAudioClip

bool PixelCrushers.DialogueSystem.UnityUITypewriterEffect.interruptAudioClip = false

If audio clip is still playing from previous character, stop and restart it when typing next character.

◆ onBegin

UnityEvent PixelCrushers.DialogueSystem.UnityUITypewriterEffect.onBegin = new UnityEvent()

◆ onCharacter

UnityEvent PixelCrushers.DialogueSystem.UnityUITypewriterEffect.onCharacter = new UnityEvent()

◆ onEnd

UnityEvent PixelCrushers.DialogueSystem.UnityUITypewriterEffect.onEnd = new UnityEvent()

◆ playOnEnable

bool PixelCrushers.DialogueSystem.UnityUITypewriterEffect.playOnEnable = true

Play using the current text content whenever component is enabled.

◆ quarterPauseDuration

float PixelCrushers.DialogueSystem.UnityUITypewriterEffect.quarterPauseDuration = 0.25f

Duration to pause when text contains '\,'

◆ removeDuplicateTypewriterEffects

bool PixelCrushers.DialogueSystem.UnityUITypewriterEffect.removeDuplicateTypewriterEffects = true

Ensures this GameObject has only one typewriter effect.

◆ rightToLeft

bool PixelCrushers.DialogueSystem.UnityUITypewriterEffect.rightToLeft = false

Set true to type right to left.

◆ silentCharacters

string PixelCrushers.DialogueSystem.UnityUITypewriterEffect.silentCharacters = string.Empty

Don't play audio on these characters.

◆ waitOneFrameBeforeStarting

bool PixelCrushers.DialogueSystem.UnityUITypewriterEffect.waitOneFrameBeforeStarting = false

Wait one frame to allow layout elements to setup first.

Property Documentation

◆ IsPlaying

bool PixelCrushers.DialogueSystem.UnityUITypewriterEffect.IsPlaying
get

Indicates whether the effect is playing.

true if this instance is playing; otherwise, false.


The documentation for this class was generated from the following file: