Text

This contains the source code documentation of the class subsystem_Text.

subsystem_Text

Inherits: DialogicSubsystem

Subsystem that handles showing of dialog text (+text effects & modifiers), name label, and next indicator

Properties


Methods

ReturnsMethod
voidclear_game_state ( _clear_flag: int = 0 )
voidload_game_state ( _load_flag: int = 0 )
voidpost_install ( )
Stringparse_text ( text: String, type: int = 0, variables: bool = true, glossary: bool = true, modifiers: bool = true, effects: bool = true, color_names: bool = true )
voidupdate_textbox ( text: String, instant: bool = false )
Stringupdate_dialog_text ( text: String, instant: bool = false, additional: bool = false )
voidupdate_name_label ( character: DialogicCharacter )
voidupdate_typing_sound_mood ( mood: Dictionary = {} )
voidshow_textbox ( instant: bool = false )
voidhide_textbox ( instant: bool = false )
boolis_textbox_visible ( )
voidshow_next_indicators ( question: bool = false, autoadvance: bool = false )
voidhide_next_indicators ( _fake_arg: Variant = null )
voidset_text_voice_synced ( enabled: bool = true )
boolis_text_voice_synced ( )
voidupdate_text_speed ( letter_speed: float = -1.0, absolute: bool = false, speed_multiplier: float = _speed_multiplier, user_speed: float = get_setting(...) )
voidset_text_reveal_skippable ( skippable: bool = true, temp: bool = false )
boolis_text_reveal_skippable ( )
voidskip_text_reveal ( )
voidcollect_text_effects ( )
Stringparse_text_effects ( text: String )
voidexecute_effects ( current_index: int, text_node: Control, skipping: bool = false )
voidcollect_text_modifiers ( )
Stringparse_text_modifiers ( text: String, type: int = 0 )
Stringget_character_name_parsed ( character: DialogicCharacter )
DialogicCharacterget_current_speaker ( )
voidconnect_meta_signals ( text_node: Node )
voidemit_meta_signal ( meta: Variant, sig: String )
Stringcolor_character_names ( text: String )
voidcollect_character_names ( )
boolsort_by_length ( a: String, b: String )
voideffect_pause ( _text_node: Control, skipped: bool, argument: String )
voideffect_speed ( _text_node: Control, skipped: bool, argument: String )
voideffect_lspeed ( _text_node: Control, skipped: bool, argument: String )
voideffect_signal ( _text_node: Control, _skipped: bool, argument: String )
voideffect_mood ( _text_node: Control, _skipped: bool, argument: String )
Stringmodifier_random_selection ( text: String )
Stringmodifier_break ( text: String )
Stringmodifier_autopauses ( text: String )

Constants

const ALL = -1

No description available.


const TEXT_ONLY = 0

No description available.


const CHOICES_ONLY = 1

No description available.


const DIALOG_TEXT = 0

No description available.


const CHOICE_TEXT = 1

No description available.


Signals

signal about_to_show_text ( info: Dictionary )

No description available.


signal text_finished ( info: Dictionary )

No description available.


signal speaker_updated ( character: DialogicCharacter )

No description available.


signal textbox_visibility_changed ( visible: bool )

No description available.


signal animation_textbox_new_text ( )

No description available.


signal animation_textbox_show ( )

No description available.


signal animation_textbox_hide ( )

No description available.


signal meta_hover_ended ( meta: Variant )

No description available.


signal meta_hover_started ( meta: Variant )

No description available.


signal meta_clicked ( meta: Variant )

No description available.


Property Descriptions

var character_colors = {}

No description available.


var color_regex = new()

No description available.


var text_already_read = false

No description available.


var text_effects = {}

No description available.


var parsed_text_effect_info = []

No description available.


var text_effects_regex = new()

No description available.


var text_modifiers = []

No description available.


var modifier_words_select_regex = create_from_string(...)

No description available.


Method Descriptions

func clear_game_state ( _clear_flag: int = 0 ) ⇒ void

No description available.


func load_game_state ( _load_flag: int = 0 ) ⇒ void

No description available.


func post_install ( ) ⇒ void

No description available.


func parse_text ( text: String, type: int = 0, variables: bool = true, glossary: bool = true, modifiers: bool = true, effects: bool = true, color_names: bool = true ) ⇒ String

Applies modifiers, effects and coloring to the text


func update_textbox ( text: String, instant: bool = false ) ⇒ void

When an event updates the text spoken, this can adjust the state of the dialog text box. This method is async.


func update_dialog_text ( text: String, instant: bool = false, additional: bool = false ) ⇒ String

Shows the given text on all visible DialogText nodes. Instant can be used to skip all revieling. If additional is true, the previous text will be kept.


func update_name_label ( character: DialogicCharacter ) ⇒ void

Updates the visible name on all name labels nodes. If a name changes, the speaker_updated signal is emitted.


func update_typing_sound_mood ( mood: Dictionary = {} ) ⇒ void

No description available.


func show_textbox ( instant: bool = false ) ⇒ void

instant skips the signal and thus possible animations


func hide_textbox ( instant: bool = false ) ⇒ void

Instant skips the signal and thus possible animations


func is_textbox_visible ( ) ⇒ bool

No description available.


func show_next_indicators ( question: bool = false, autoadvance: bool = false ) ⇒ void

No description available.


func hide_next_indicators ( _fake_arg: Variant = null ) ⇒ void

No description available.


func set_text_voice_synced ( enabled: bool = true ) ⇒ void

This method will sync the text speed to the voice audio clip length, if a voice is playing. For instance, if the voice is playing for four seconds, the text will finish revealing after this time. This feature ignores Auto-Pauses on letters. Pauses via BBCode will desync the reveal.


func is_text_voice_synced ( ) ⇒ bool

Returns whether voice-synced text is enabled.


func update_text_speed ( letter_speed: float = -1.0, absolute: bool = false, speed_multiplier: float = _speed_multiplier, user_speed: float = get_setting(...) ) ⇒ void

Sets how fast text will be revealed.

letter_speed is the speed a single text character takes to appear on the textbox.

absolute will force text to display at the given speed, regardless of the user's text speed setting.

_speed_multiplier adjusts the speed of the text, if set to -1, the value won't be updated and the current value will persist.

_user_speed adjusts the speed of the text, if set to -1, the project setting 'text_speed' will be used.operator


func set_text_reveal_skippable ( skippable: bool = true, temp: bool = false ) ⇒ void

No description available.


func is_text_reveal_skippable ( ) ⇒ bool

No description available.


func skip_text_reveal ( ) ⇒ void

No description available.


func collect_text_effects ( ) ⇒ void

No description available.


func parse_text_effects ( text: String ) ⇒ String

Returns the string with all text effects removed Use get_parsed_text_effects() after calling this to get all effect information


func execute_effects ( current_index: int, text_node: Control, skipping: bool = false ) ⇒ void

No description available.


func collect_text_modifiers ( ) ⇒ void

No description available.


func parse_text_modifiers ( text: String, type: int = 0 ) ⇒ String

No description available.


func get_character_name_parsed ( character: DialogicCharacter ) ⇒ String

Parses the character's display_name and returns the text that should be rendered. Note that characters may have variables in their name, therefore this function should be called to evaluate any potential variables in a character's name.


func get_current_speaker ( ) ⇒ DialogicCharacter

Returns the DialogicCharacter of the current speaker. If there is no current speaker or the speaker is not found, returns null.


func connect_meta_signals ( text_node: Node ) ⇒ void

No description available.


func emit_meta_signal ( meta: Variant, sig: String ) ⇒ void

No description available.


func color_character_names ( text: String ) ⇒ String

No description available.


func collect_character_names ( ) ⇒ void

No description available.


func sort_by_length ( a: String, b: String ) ⇒ bool

No description available.


func effect_pause ( _text_node: Control, skipped: bool, argument: String ) ⇒ void

No description available.


func effect_speed ( _text_node: Control, skipped: bool, argument: String ) ⇒ void

No description available.


func effect_lspeed ( _text_node: Control, skipped: bool, argument: String ) ⇒ void

No description available.


func effect_signal ( _text_node: Control, _skipped: bool, argument: String ) ⇒ void

No description available.


func effect_mood ( _text_node: Control, _skipped: bool, argument: String ) ⇒ void

No description available.


func modifier_random_selection ( text: String ) ⇒ String

No description available.


func modifier_break ( text: String ) ⇒ String

No description available.


func modifier_autopauses ( text: String ) ⇒ String

No description available.