EasyTalk API
Loading...
Searching...
No Matches
EasyTalk.Display.TextInputDisplay Class Reference

A display for obtaining text input from the plpayer during dialogue playback. More...

Inheritance diagram for EasyTalk.Display.TextInputDisplay:
EasyTalk.Display.DialoguePanel EasyTalk.Controller.DialogueListener EasyTalk.Display.LocalizableComponent

Public Member Functions

void LastCharacter ()
 Switches the currently selected input character to the last character in the character list.
 
void NextCharacter ()
 Switches the currently selected input character to the next character in the character list.
 
void CycleNextCharacters ()
 Turns on input character cycling, meaning the input display will cycle through to the next input character automatically while a gamepad input is held down.
 
void CycleLastCharacters ()
 Turns on input character cycling, meaning the input display will cycle through to the previous input character automatically while a gamepad input is held down.
 
void StopCharacterCycling ()
 Turns automatic input character cycling off.
 
void MoveCursorLeft ()
 Moves the cursor (caret position) left by one character.
 
void MoveCursorRight ()
 Moves the cursor (caret position) right by one character.
 
string GetText ()
 Returns the current text value of the input display.
 
void SetText (string text)
 Sets the text value of the input display.
 
void Reset ()
 Resets the text input.
 
void SetInputNode (PlayerInputNode node)
 Sets the active PlayerInput node. This method also sets the hint/placeholder text configured in the node.
 
void TextInputEntered ()
 When called, this will call TextInputEntered() with the current text of the input field.
 
- Public Member Functions inherited from EasyTalk.Display.DialoguePanel
virtual void Init ()
 Initializes the panel by storing the original position.
 
void Activate ()
 Sets the panel to be active, and recursively sets all parent game objects to be active.
 
void Deactivate ()
 Makes the panel inactive.
 
bool ForceStandardText ()
 Returns whether or not the panel should force standard text component usage, even when TextMesh Pro is available.
 
IEnumerator WaitForAnimation ()
 Asynchronously waits for the currently running animation on this panel to complete.
 
virtual void Hide (bool deactivateAfterHide=true)
 Hides the panel.
 
void HideImmediately (bool deactivateAfterHide=true)
 Hides the panel immediately (doesn't use a transition animation).
 
void ShowImmediately ()
 Shows the panel immediately (doesn't use a transition animation).
 
virtual void Show ()
 Shows the panel.
 
- Public Member Functions inherited from EasyTalk.Controller.DialogueListener
virtual void OnContinue ()
 Called whenever the dialogue continues on to the next line.
 
virtual void OnDisplayOptions (List< DialogueOption > options)
 Called whenever dialogue options are to be presented.
 
virtual void OnOptionChosen (DialogueOption option)
 Called whenever an option is chosen from the currently presented list of options.
 
virtual void OnDisplayLine (ConversationLine conversationLine)
 Called when a line of dialogue is to be presented.
 
virtual void OnDialogueEntered (string entryPointName)
 Called whenever a dialogue is entered (when playback begins).
 
virtual void OnDialogueExited (string exitPointName)
 Called whenever a dialogue is exited (when playback ends).
 
virtual void OnExitCompleted ()
 Called at least one frame after a dialogue is exited.
 
virtual void OnStory (string storyText)
 Called whenever a story node is encountered.
 
virtual void OnVariableUpdated (string variableName, object value)
 Called whenever a dialogue variable value is updated.
 
virtual void OnCharacterChanged (string oldCharacterName, string newCharacterName)
 Called whenever a character change is detected.
 
virtual void OnAudioStarted (ConversationLine line)
 Called whenever audio starts playing for a line of dialogue.
 
virtual void OnAudioCompleted (ConversationLine line, bool forceStopped)
 Called whenever audio stops playing for a line of dialogue.
 
virtual void OnActivateKey (string key)
 Called whenever a key tag is present in a line of dialogue.
 
virtual void Wait (float timeInSeconds)
 Called whenever the dialogue encounters a wait node.
 
virtual void OnConversationEnding (ConversationLine line, Node nextNode)
 Called whenever the last line of dialogue in a conversation node is reached.
 
virtual void OnNodeChanged (Node node)
 Called whenever dialogue playback moves to the next node.
 
virtual void OnPause (string signal)
 Called whenever a pause node is reached during dialogue playback.
 
virtual void OnAppendText (string text)
 Called whenever text is to be appended to the current dialogue's conversation text.
 
virtual void OnExecuteAsyncNode (AsyncNode node)
 Called whenever an async node is encountered and needs some external class to handle its execution.
 
virtual void OnWaitingForNodeEvaluation (Node asyncNode)
 Called just before an asynchronous node is executed to notify listeners that the dialogue is about to enter a waiting state.
 
virtual void OnNodeEvaluationCompleted (Node asyncNode)
 Called whenever an asynchronous node's evaluation/execution has been commpleted.
 

Protected Member Functions

void LanguageChanged (string oldLanguage, string newLanguage)
 Called whenever the language is changed on the EasyTalkGameState. This will attempt to update the character set used by the input display.
 
- Protected Member Functions inherited from EasyTalk.Display.DialoguePanel
IEnumerator SlideDisplayOut (bool deactivateAfterSlide=true)
 Asynchronously slides the display out of its Canvas' bounds.
 
IEnumerator SlideDisplayIn ()
 Asynchronously slides the display into its Canvas' bounds. If returnToOriginalPosition is set to true, then the panel will slide to its original position.
 
IEnumerator FadeDisplayIn ()
 Asynchronously fades the display and all of its child text and image components in to their original transparency values.
 
IEnumerator FadeDisplayOut (bool deactivateAfterFade=true)
 Asynchronously fades the display and all of its child text and image components out to be completely transparent.
 
virtual void OnShowStart ()
 Callback for when the panel begines to be shown.
 
virtual void OnShowComplete ()
 Callback for when the panel is finished being shown (when all animations are complete).
 
virtual void OnHideStart ()
 Callback for when the panel begins to be hidden.
 
virtual void OnHideComplete ()
 Callback for when the panel has finished being hidden (when all animations are complete).
 

Properties

bool HideOnAwake [get, set]
 Gets or sets wether or not the display will b e hidden immediately on Awake().
 
- Properties inherited from EasyTalk.Display.DialoguePanel
string DisplayID [get, set]
 Gets or sets the Display ID of the panel.
 
bool IsHidden [get]
 Gets whether the panel is currently hidden.
 
Vector3 OriginalPosition [get]
 Gets the original position of the panel.
 
UIAnimator.Animation AnimationType [get, set]
 Gets or sets the animation type used for showing and hiding the panel.
 
bool OverrideFontSizes [get, set]
 Gets or sets whether the panel should override the default language-specific minimum and maximum font sizes when the language is updated.
 
LanguageFontOverrides LanguageFontOverrides [get, set]
 Gets or sets the LanguageFontOverrides which are used to change fonts when the language is changed.
 
int MinFontSize [get, set]
 Gets or sets the minimum font size to use.
 
int MaxFontSize [get, set]
 Gets or sets the maximum font size to use.
 
- Properties inherited from EasyTalk.Display.LocalizableComponent

Private Member Functions

void Awake ()
 
void OnDestroy ()
 
void UpdateInputCharacterSet ()
 Update the characters being used.
 
void Update ()
 
void UpdateCharacterAtCursor ()
 Changes the text input character at the current caret position to the currently selected character.
 
void SetCurrentCharacter (char character)
 Searches through the input character list to find the specified character and sets the currently selected character index if found.
 
int GetCaretPosition ()
 Returns the current caret position of the input display.
 
void SetCaretPosition (int pos)
 Sets the current caret position of the input display.
 
void FocusTextInput ()
 Gives the text input focus.
 
void TextInputEntered (string text)
 Sets the text entered by the player on the active PlayerInput node and calls ExecutionCompleted();.
 
void OnValidate ()
 

Private Attributes

InputField inputField
 The text input field.
 
PlayerInputNode inputNode
 The PlayerInput node being processed.
 
bool hideOnAwake = true
 Whether the input display should be hidden immediately on awake.
 
char[] defaultCharacters
 The default set of characters which the player can cycle through if using a gamepad.
 
char[] inputCharacters = null
 The set of input characters in use (only applicable when cycling via a gamepad).
 
int currentCharacter = 0
 The index of the character currently chosen as the gamepad input character.
 
bool cyclingCharactersForward = false
 Whether the display should quickly cycle forward through input characters (if a gamepad button is held down).
 
bool cyclingCharactersBackward = false
 Whether the display should quickly cycle backwards through input characters (if a gamepad button is held down).
 
float lastCycleTime = 0.0f
 Keeps track of the last time at which the input character was cycled (only relevant when a gamepad button is held down).
 
float cycleDelay = 0.1f
 /The delay between switching input characters when they are being cycled (only relevant when a gamepad button is held down).
 

Additional Inherited Members

- Public Attributes inherited from EasyTalk.Display.DialoguePanel
UnityEvent onHideStart = new UnityEvent()
 An event which is triggered whenever the panel starts being hidden.
 
UnityEvent onHideComplete = new UnityEvent()
 An event which is triggered whenever the panel has finished transitioning to a hidden state.
 
UnityEvent onShowStart = new UnityEvent()
 An event which is triggered whenever the panel starts being shown.
 
UnityEvent onShowComplete = new UnityEvent()
 An event which is triggered whenever the panel has finished transitioning to a shown state.
 
- Public Attributes inherited from EasyTalk.Controller.DialogueListener
bool debugEnabled = false
 When set to true, debug logging will be shown for each method called on the listener.
 
UnityEvent onContinue = new UnityEvent()
 An event which is triggered whenever the dialogue continues.
 
UnityEvent onDisplayOptions = new UnityEvent()
 An event which is triggered whenever options are to be displayed to the player.
 
UnityEvent onOptionChosen = new UnityEvent()
 An event which is triggered whenever the player chooses an option.
 
UnityEvent onDisplayLine = new UnityEvent()
 An event which is triggered whenever a line of dialogue is to be displayed.
 
UnityEvent onDialogueEntered = new UnityEvent()
 An event which is triggered whenever dialogue playback begins.
 
UnityEvent onDialogueExited = new UnityEvent()
 An event which is triggered whenever dialogue playback ends.
 
UnityEvent onExitCompleted = new UnityEvent()
 An event which is triggered one frame after dialogue playback ends.
 
UnityEvent onStory = new UnityEvent()
 An event which is triggered whenever a story node is encountered.
 
UnityEvent onVariableUpdated = new UnityEvent()
 An event which is triggered whenever a dialogue variable value is updated.
 
UnityEvent onCharacterChanged = new UnityEvent()
 An event which is triggered whenever a character name change is detected.
 
UnityEvent onAudioStarted = new UnityEvent()
 An event which is triggered whenever dialogue audio starts playing.
 
UnityEvent onAudioCompleted = new UnityEvent()
 An event which is triggered whenever dialogue audio finishes playing.
 
UnityEvent onActivateKey = new UnityEvent()
 An event which is triggered whenever a key is to be processed on a dialogue.
 
UnityEvent onWait = new UnityEvent()
 An event which is triggered whenever a dialogue starts waiting for a certain period of time before continuing.
 
UnityEvent onConversationEnding = new UnityEvent()
 An event which is triggered whenever the last line of dialogue in a conversation node is reached.
 
UnityEvent onNodeChanged = new UnityEvent()
 An event which is triggered whenever a the dialogue flows from one node to another.
 
UnityEvent onPause = new UnityEvent()
 An event which is triggered whenever the dialogue reaches a pause node, pausing and waiting for Continue() to be called.
 
UnityEvent onExecuteAsyncNode = new UnityEvent()
 An event which is triggered whenever an asynchronous node must be processed.
 
UnityEvent onAppendText = new UnityEvent()
 
UnityEvent onWaitingForNodeCompletion = new UnityEvent()
 
UnityEvent onNodeEvaluationCompleted = new UnityEvent()
 
- Protected Attributes inherited from EasyTalk.Display.DialoguePanel
bool forceStandardText = false
 Whether the Display uses standard Text components rather than TextMeshPro components, even with TextMeshPro installed.
 
Vector3 originalPosition = Vector3.zero
 The original position of the panel.
 
bool isHidden = false
 Whether the panel is currently hidden.
 

Detailed Description

A display for obtaining text input from the plpayer during dialogue playback.

Member Function Documentation

◆ Awake()

void EasyTalk.Display.TextInputDisplay.Awake ( )
private

◆ CycleLastCharacters()

void EasyTalk.Display.TextInputDisplay.CycleLastCharacters ( )

Turns on input character cycling, meaning the input display will cycle through to the previous input character automatically while a gamepad input is held down.

◆ CycleNextCharacters()

void EasyTalk.Display.TextInputDisplay.CycleNextCharacters ( )

Turns on input character cycling, meaning the input display will cycle through to the next input character automatically while a gamepad input is held down.

◆ FocusTextInput()

void EasyTalk.Display.TextInputDisplay.FocusTextInput ( )
private

Gives the text input focus.

◆ GetCaretPosition()

int EasyTalk.Display.TextInputDisplay.GetCaretPosition ( )
private

Returns the current caret position of the input display.

Returns

◆ GetText()

string EasyTalk.Display.TextInputDisplay.GetText ( )

Returns the current text value of the input display.

Returns

◆ LanguageChanged()

void EasyTalk.Display.TextInputDisplay.LanguageChanged ( string oldLanguage,
string newLanguage )
protected

Called whenever the language is changed on the EasyTalkGameState. This will attempt to update the character set used by the input display.

Parameters
oldLanguageThe prior language being used.
newLanguageThe new language to use.

◆ LastCharacter()

void EasyTalk.Display.TextInputDisplay.LastCharacter ( )

Switches the currently selected input character to the last character in the character list.

◆ MoveCursorLeft()

void EasyTalk.Display.TextInputDisplay.MoveCursorLeft ( )

Moves the cursor (caret position) left by one character.

◆ MoveCursorRight()

void EasyTalk.Display.TextInputDisplay.MoveCursorRight ( )

Moves the cursor (caret position) right by one character.

◆ NextCharacter()

void EasyTalk.Display.TextInputDisplay.NextCharacter ( )

Switches the currently selected input character to the next character in the character list.

◆ OnDestroy()

void EasyTalk.Display.TextInputDisplay.OnDestroy ( )
private

◆ OnValidate()

void EasyTalk.Display.TextInputDisplay.OnValidate ( )
private

◆ Reset()

void EasyTalk.Display.TextInputDisplay.Reset ( )

Resets the text input.

◆ SetCaretPosition()

void EasyTalk.Display.TextInputDisplay.SetCaretPosition ( int pos)
private

Sets the current caret position of the input display.

Parameters
posThe position to place the caret (cursor) at.

◆ SetCurrentCharacter()

void EasyTalk.Display.TextInputDisplay.SetCurrentCharacter ( char character)
private

Searches through the input character list to find the specified character and sets the currently selected character index if found.

Parameters
character

◆ SetInputNode()

void EasyTalk.Display.TextInputDisplay.SetInputNode ( PlayerInputNode node)

Sets the active PlayerInput node. This method also sets the hint/placeholder text configured in the node.

Parameters
nodeThe PlayerInput node to use.

◆ SetText()

void EasyTalk.Display.TextInputDisplay.SetText ( string text)

Sets the text value of the input display.

Parameters
textThe text to set.

◆ StopCharacterCycling()

void EasyTalk.Display.TextInputDisplay.StopCharacterCycling ( )

Turns automatic input character cycling off.

◆ TextInputEntered() [1/2]

void EasyTalk.Display.TextInputDisplay.TextInputEntered ( )

When called, this will call TextInputEntered() with the current text of the input field.

◆ TextInputEntered() [2/2]

void EasyTalk.Display.TextInputDisplay.TextInputEntered ( string text)
private

Sets the text entered by the player on the active PlayerInput node and calls ExecutionCompleted();.

Parameters
text

◆ Update()

void EasyTalk.Display.TextInputDisplay.Update ( )
private

◆ UpdateCharacterAtCursor()

void EasyTalk.Display.TextInputDisplay.UpdateCharacterAtCursor ( )
private

Changes the text input character at the current caret position to the currently selected character.

◆ UpdateInputCharacterSet()

void EasyTalk.Display.TextInputDisplay.UpdateInputCharacterSet ( )
private

Update the characters being used.

Member Data Documentation

◆ currentCharacter

int EasyTalk.Display.TextInputDisplay.currentCharacter = 0
private

The index of the character currently chosen as the gamepad input character.

◆ cycleDelay

float EasyTalk.Display.TextInputDisplay.cycleDelay = 0.1f
private

/The delay between switching input characters when they are being cycled (only relevant when a gamepad button is held down).

◆ cyclingCharactersBackward

bool EasyTalk.Display.TextInputDisplay.cyclingCharactersBackward = false
private

Whether the display should quickly cycle backwards through input characters (if a gamepad button is held down).

◆ cyclingCharactersForward

bool EasyTalk.Display.TextInputDisplay.cyclingCharactersForward = false
private

Whether the display should quickly cycle forward through input characters (if a gamepad button is held down).

◆ defaultCharacters

char [] EasyTalk.Display.TextInputDisplay.defaultCharacters
private
Initial value:
= new char[] {
' ',
'A', 'B', 'C', 'D', 'E', 'F',
'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', 'a', 'b', 'c', 'd',
'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p',
'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z'}

The default set of characters which the player can cycle through if using a gamepad.

◆ hideOnAwake

bool EasyTalk.Display.TextInputDisplay.hideOnAwake = true
private

Whether the input display should be hidden immediately on awake.

◆ inputCharacters

char [] EasyTalk.Display.TextInputDisplay.inputCharacters = null
private

The set of input characters in use (only applicable when cycling via a gamepad).

◆ inputField

InputField EasyTalk.Display.TextInputDisplay.inputField
private

The text input field.

◆ inputNode

PlayerInputNode EasyTalk.Display.TextInputDisplay.inputNode
private

The PlayerInput node being processed.

◆ lastCycleTime

float EasyTalk.Display.TextInputDisplay.lastCycleTime = 0.0f
private

Keeps track of the last time at which the input character was cycled (only relevant when a gamepad button is held down).

Property Documentation

◆ HideOnAwake

bool EasyTalk.Display.TextInputDisplay.HideOnAwake
getset

Gets or sets wether or not the display will b e hidden immediately on Awake().