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
Name | Type | Default |
---|---|---|
character_colors | Dictionary | {} |
color_regex | RegEx | new() |
text_already_read | bool | false |
text_effects | Dictionary | {} |
parsed_text_effect_info | Dictionary[] | [] |
text_effects_regex | RegEx | new() |
text_modifiers | Array | [] |
parse_stack | Dictionary[] | [] |
modifier_select_regex | RegEx | create_from_string(...) |
modifier_select_split_regex | RegEx | create_from_string(...) |
Methods
Constants
No description available.
No description available.
No description available.
No description available.
No description available.
Signals
signal about_to_show_text ( info
: Dictionary )
Emitted when a text event is reached or a new text section is about to be shown. Gives a dictionary with the following keys:
Key | Value Type | Value |
---|---|---|
text | String | The text that is being displayed. |
character | DialogicCharacter | The character that says this text. |
portrait | String | The name of the portrait the character will use. |
append | bool | Whether the text will be appended to the previous text. |
signal text_started ( info
: Dictionary )
Emitted when a text event (or a new text section) starts displaying. This will be AFTER the textox animation, while about_to_show_text is before. Gives a dictionary with the same values as about_to_show_text
signal text_finished ( info
: Dictionary )
When the text has finished revealing. Gives a dictionary with the keys text and character.
signal speaker_updated ( character
: DialogicCharacter )
Emitted when the speaker changes.
signal textbox_visibility_changed ( visible
: bool )
Emitted when the textbox is shown or hidden.
signal animation_textbox_show ( )
Emitted when the textbox appears. Use this together with the Animations subsystem to implement animations. If you start an animation and want dialogic to wait for it to finish before showing text, call Dialogic.Animations.start_animating() and then Dialogic.animation_finished() once it's done.
signal animation_textbox_hide ( )
Emitted when the textbox is hiding. Use like animation_textbox_show.
signal animation_textbox_new_text ( )
Emitted when a new text starts. Use like animation_textbox_show.
signal meta_hover_started ( meta
: Variant )
Emitted when a meta text on any DialogText node is hovered.
signal meta_hover_ended ( meta
: Variant )
Emitted when a meta text on any DialogText node is not hovered anymore.
signal meta_clicked ( meta
: Variant )
Emitted when a meta text on any DialogText node is clicked.
Property Descriptions
No description available.
No description available.
No description available.
No description available.
var parsed_text_effect_info = []
No description available.
var text_effects_regex = new()
No description available.
No description available.
No description available.
var modifier_select_regex = create_from_string(...)
No description available.
var modifier_select_split_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.
No description available.
func parse_text ( text
: String, type
: int = 0
) ⇒ String
Applies modifiers, effects and coloring to the text. Utilizes the parse stack created and sorted in [method load_parse_stack()].
func load_parse_stack ( ) ⇒ void
Creates and sorts a stack of methods that take a text and return it. This includes: variables, text modifiers, text effects, autocolor names and the glossary.
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_from_character ( character
: DialogicCharacter, mood
: String ) ⇒ void
No description available.
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 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.