v3.11.4 Documentation
Fungus.Writer Class Reference

Writes text using a typewriter effect to a UI text object. More...

Inheritance diagram for Fungus.Writer:
Fungus.IDialogInputListener

Public Member Functions

virtual void Stop ()
 Stop writing text. More...
 
virtual IEnumerator Write (string content, bool clear, bool waitForInput, bool stopAudio, bool waitForVO, AudioClip audioClip, Action onComplete)
 Writes text using a typewriter effect to a UI text object. More...
 
void SetTextColor (Color textColor)
 
void SetTextAlpha (float textAlpha)
 
virtual void OnNextLineEvent ()
 

Protected Member Functions

virtual void Awake ()
 
virtual void CacheHiddenColorStrings ()
 
virtual void Start ()
 
virtual void UpdateOpenMarkup ()
 
virtual void UpdateCloseMarkup ()
 
virtual bool CheckParamCount (List< string > paramList, int count)
 
virtual bool TryGetSingleParam (List< string > paramList, int index, float defaultValue, out float value)
 
virtual IEnumerator ProcessTokens (List< TextTagToken > tokens, bool stopAudio, Action onComplete)
 
virtual IEnumerator DoWords (List< string > paramList, TokenType previousTokenType)
 
virtual void PartitionString (bool wholeWords, string inputString, int i)
 
virtual void ConcatenateString (string startText)
 
virtual IEnumerator DoWait (List< string > paramList)
 
virtual IEnumerator DoWaitVO ()
 
virtual IEnumerator DoWait (float duration)
 
virtual IEnumerator DoWaitForInput (bool clear)
 
virtual bool IsPunctuation (char character)
 
virtual void Punch (Vector3 axis, float time)
 
virtual void Flash (float duration)
 
virtual AudioSource FindAudio (string audioObjectName)
 
virtual void NotifyInput ()
 
virtual void NotifyStart (AudioClip audioClip)
 
virtual void NotifyPause ()
 
virtual void NotifyResume ()
 
virtual void NotifyEnd (bool stopAudio)
 
virtual void NotifyGlyph ()
 

Protected Attributes

GameObject targetTextObject
 
GameObject punchObject
 
float writingSpeed = 60
 
float punctuationPause = 0.25f
 
Color hiddenTextColor = new Color(1,1,1,0)
 
bool writeWholeWords = false
 
bool forceRichText = true
 
bool instantComplete = true
 
bool isWaitingForInput
 
bool isWriting
 
float currentWritingSpeed
 
float currentPunctuationPause
 
TextAdapter textAdapter = new TextAdapter()
 
bool boldActive = false
 
bool italicActive = false
 
bool colorActive = false
 
string colorText = ""
 
bool sizeActive = false
 
float sizeValue = 16f
 
bool inputFlag
 
bool exitFlag
 
List< IWriterListenerwriterListeners = new List<IWriterListener>()
 
StringBuilder openString = new StringBuilder(256)
 
StringBuilder closeString = new StringBuilder(256)
 
StringBuilder leftString = new StringBuilder(1024)
 
StringBuilder rightString = new StringBuilder(1024)
 
StringBuilder outputString = new StringBuilder(1024)
 
StringBuilder readAheadString = new StringBuilder(1024)
 
string hiddenColorOpen = ""
 
string hiddenColorClose = ""
 
int visibleCharacterCount = 0
 

Properties

WriterAudio AttachedWriterAudio [get, set]
 
virtual bool IsWriting [get]
 This property is true when the writer is writing text or waiting (i.e. More...
 
virtual bool IsWaitingForInput [get]
 This property is true when the writer is waiting for user input to continue. More...
 
virtual bool Paused [get, set]
 Pauses the writer. More...
 

Detailed Description

Writes text using a typewriter effect to a UI text object.

Definition at line 34 of file Writer.cs.

Member Function Documentation

◆ Awake()

virtual void Fungus.Writer.Awake ( )
protectedvirtual

Definition at line 94 of file Writer.cs.

◆ CacheHiddenColorStrings()

virtual void Fungus.Writer.CacheHiddenColorStrings ( )
protectedvirtual

Definition at line 119 of file Writer.cs.

◆ CheckParamCount()

virtual bool Fungus.Writer.CheckParamCount ( List< string >  paramList,
int  count 
)
protectedvirtual

Definition at line 189 of file Writer.cs.

◆ ConcatenateString()

virtual void Fungus.Writer.ConcatenateString ( string  startText)
protectedvirtual

Definition at line 582 of file Writer.cs.

◆ DoWait() [1/2]

virtual IEnumerator Fungus.Writer.DoWait ( List< string >  paramList)
protectedvirtual

Definition at line 613 of file Writer.cs.

◆ DoWait() [2/2]

virtual IEnumerator Fungus.Writer.DoWait ( float  duration)
protectedvirtual

Definition at line 642 of file Writer.cs.

◆ DoWaitForInput()

virtual IEnumerator Fungus.Writer.DoWaitForInput ( bool  clear)
protectedvirtual

Definition at line 661 of file Writer.cs.

◆ DoWaitVO()

virtual IEnumerator Fungus.Writer.DoWaitVO ( )
protectedvirtual

Definition at line 630 of file Writer.cs.

◆ DoWords()

virtual IEnumerator Fungus.Writer.DoWords ( List< string >  paramList,
TokenType  previousTokenType 
)
protectedvirtual

Definition at line 470 of file Writer.cs.

◆ FindAudio()

virtual AudioSource Fungus.Writer.FindAudio ( string  audioObjectName)
protectedvirtual

Definition at line 720 of file Writer.cs.

◆ Flash()

virtual void Fungus.Writer.Flash ( float  duration)
protectedvirtual

Definition at line 709 of file Writer.cs.

◆ IsPunctuation()

virtual bool Fungus.Writer.IsPunctuation ( char  character)
protectedvirtual

Definition at line 684 of file Writer.cs.

◆ NotifyEnd()

virtual void Fungus.Writer.NotifyEnd ( bool  stopAudio)
protectedvirtual

Definition at line 775 of file Writer.cs.

◆ NotifyGlyph()

virtual void Fungus.Writer.NotifyGlyph ( )
protectedvirtual

Definition at line 786 of file Writer.cs.

◆ NotifyInput()

virtual void Fungus.Writer.NotifyInput ( )
protectedvirtual

Definition at line 731 of file Writer.cs.

◆ NotifyPause()

virtual void Fungus.Writer.NotifyPause ( )
protectedvirtual

Definition at line 753 of file Writer.cs.

◆ NotifyResume()

virtual void Fungus.Writer.NotifyResume ( )
protectedvirtual

Definition at line 764 of file Writer.cs.

◆ NotifyStart()

virtual void Fungus.Writer.NotifyStart ( AudioClip  audioClip)
protectedvirtual

Definition at line 742 of file Writer.cs.

◆ OnNextLineEvent()

virtual void Fungus.Writer.OnNextLineEvent ( )
virtual

Implements Fungus.IDialogInputListener.

Definition at line 887 of file Writer.cs.

◆ PartitionString()

virtual void Fungus.Writer.PartitionString ( bool  wholeWords,
string  inputString,
int  i 
)
protectedvirtual

Definition at line 548 of file Writer.cs.

◆ ProcessTokens()

virtual IEnumerator Fungus.Writer.ProcessTokens ( List< TextTagToken tokens,
bool  stopAudio,
Action  onComplete 
)
protectedvirtual

Definition at line 215 of file Writer.cs.

◆ Punch()

virtual void Fungus.Writer.Punch ( Vector3  axis,
float  time 
)
protectedvirtual

Definition at line 695 of file Writer.cs.

◆ SetTextAlpha()

void Fungus.Writer.SetTextAlpha ( float  textAlpha)

Definition at line 876 of file Writer.cs.

◆ SetTextColor()

void Fungus.Writer.SetTextColor ( Color  textColor)

Definition at line 871 of file Writer.cs.

◆ Start()

virtual void Fungus.Writer.Start ( )
protectedvirtual

Definition at line 127 of file Writer.cs.

◆ Stop()

virtual void Fungus.Writer.Stop ( )
virtual

Stop writing text.

Definition at line 817 of file Writer.cs.

◆ TryGetSingleParam()

virtual bool Fungus.Writer.TryGetSingleParam ( List< string >  paramList,
int  index,
float  defaultValue,
out float  value 
)
protectedvirtual

Definition at line 204 of file Writer.cs.

◆ UpdateCloseMarkup()

virtual void Fungus.Writer.UpdateCloseMarkup ( )
protectedvirtual

Definition at line 164 of file Writer.cs.

◆ UpdateOpenMarkup()

virtual void Fungus.Writer.UpdateOpenMarkup ( )
protectedvirtual

Definition at line 135 of file Writer.cs.

◆ Write()

virtual IEnumerator Fungus.Writer.Write ( string  content,
bool  clear,
bool  waitForInput,
bool  stopAudio,
bool  waitForVO,
AudioClip  audioClip,
Action  onComplete 
)
virtual

Writes text using a typewriter effect to a UI text object.

Parameters
contentText to be written
clearIf true clears the previous text.
waitForInputWrites the text and then waits for player input before calling onComplete.
stopAudioStops any currently playing audioclip.
waitForVOWait for the Voice over to complete before proceeding
audioClipAudio clip to play when text starts writing.
onCompleteCallback to call when writing is finished.

Definition at line 835 of file Writer.cs.

Member Data Documentation

◆ boldActive

bool Fungus.Writer.boldActive = false
protected

Definition at line 70 of file Writer.cs.

◆ closeString

StringBuilder Fungus.Writer.closeString = new StringBuilder(256)
protected

Definition at line 82 of file Writer.cs.

◆ colorActive

bool Fungus.Writer.colorActive = false
protected

Definition at line 72 of file Writer.cs.

◆ colorText

string Fungus.Writer.colorText = ""
protected

Definition at line 73 of file Writer.cs.

◆ currentPunctuationPause

float Fungus.Writer.currentPunctuationPause
protected

Definition at line 67 of file Writer.cs.

◆ currentWritingSpeed

float Fungus.Writer.currentWritingSpeed
protected

Definition at line 66 of file Writer.cs.

◆ exitFlag

bool Fungus.Writer.exitFlag
protected

Definition at line 77 of file Writer.cs.

◆ forceRichText

bool Fungus.Writer.forceRichText = true
protected

Definition at line 55 of file Writer.cs.

◆ hiddenColorClose

string Fungus.Writer.hiddenColorClose = ""
protected

Definition at line 89 of file Writer.cs.

◆ hiddenColorOpen

string Fungus.Writer.hiddenColorOpen = ""
protected

Definition at line 88 of file Writer.cs.

◆ hiddenTextColor

Color Fungus.Writer.hiddenTextColor = new Color(1,1,1,0)
protected

Definition at line 49 of file Writer.cs.

◆ inputFlag

bool Fungus.Writer.inputFlag
protected

Definition at line 76 of file Writer.cs.

◆ instantComplete

bool Fungus.Writer.instantComplete = true
protected

Definition at line 58 of file Writer.cs.

◆ isWaitingForInput

bool Fungus.Writer.isWaitingForInput
protected

Definition at line 61 of file Writer.cs.

◆ isWriting

bool Fungus.Writer.isWriting
protected

Definition at line 64 of file Writer.cs.

◆ italicActive

bool Fungus.Writer.italicActive = false
protected

Definition at line 71 of file Writer.cs.

◆ leftString

StringBuilder Fungus.Writer.leftString = new StringBuilder(1024)
protected

Definition at line 83 of file Writer.cs.

◆ openString

StringBuilder Fungus.Writer.openString = new StringBuilder(256)
protected

Definition at line 81 of file Writer.cs.

◆ outputString

StringBuilder Fungus.Writer.outputString = new StringBuilder(1024)
protected

Definition at line 85 of file Writer.cs.

◆ punchObject

GameObject Fungus.Writer.punchObject
protected

Definition at line 40 of file Writer.cs.

◆ punctuationPause

float Fungus.Writer.punctuationPause = 0.25f
protected

Definition at line 46 of file Writer.cs.

◆ readAheadString

StringBuilder Fungus.Writer.readAheadString = new StringBuilder(1024)
protected

Definition at line 86 of file Writer.cs.

◆ rightString

StringBuilder Fungus.Writer.rightString = new StringBuilder(1024)
protected

Definition at line 84 of file Writer.cs.

◆ sizeActive

bool Fungus.Writer.sizeActive = false
protected

Definition at line 74 of file Writer.cs.

◆ sizeValue

float Fungus.Writer.sizeValue = 16f
protected

Definition at line 75 of file Writer.cs.

◆ targetTextObject

GameObject Fungus.Writer.targetTextObject
protected

Definition at line 37 of file Writer.cs.

◆ textAdapter

TextAdapter Fungus.Writer.textAdapter = new TextAdapter()
protected

Definition at line 68 of file Writer.cs.

◆ visibleCharacterCount

int Fungus.Writer.visibleCharacterCount = 0
protected

Definition at line 91 of file Writer.cs.

◆ writerListeners

List<IWriterListener> Fungus.Writer.writerListeners = new List<IWriterListener>()
protected

Definition at line 79 of file Writer.cs.

◆ writeWholeWords

bool Fungus.Writer.writeWholeWords = false
protected

Definition at line 52 of file Writer.cs.

◆ writingSpeed

float Fungus.Writer.writingSpeed = 60
protected

Definition at line 43 of file Writer.cs.

Property Documentation

◆ AttachedWriterAudio

WriterAudio Fungus.Writer.AttachedWriterAudio
getset

Definition at line 92 of file Writer.cs.

◆ IsWaitingForInput

virtual bool Fungus.Writer.IsWaitingForInput
get

This property is true when the writer is waiting for user input to continue.

Definition at line 807 of file Writer.cs.

◆ IsWriting

virtual bool Fungus.Writer.IsWriting
get

This property is true when the writer is writing text or waiting (i.e.

still processing tokens).

Definition at line 802 of file Writer.cs.

◆ Paused

virtual bool Fungus.Writer.Paused
getset

Pauses the writer.

Definition at line 812 of file Writer.cs.


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