DialogueLabel is a specialized RichTextLabel node that handles animated text typing effects for dialogue. It extends Godot’s RichTextLabel with automatic typing animations, pause controls, and inline mutation support.
Exports
The input action to press to skip typing out the dialogue text.
The speed with which the text types out. Lower values make typing faster.
Automatically have a brief pause when these characters are encountered during typing.
Don’t auto pause if the character after the pause character is one of these.
Don’t auto pause after these abbreviations (only if ”.” is in
pause_at_characters). Abbreviations are limited to 5 characters in length and do not support multi-period abbreviations (e.g., “p.m.”).The amount of time to pause when exposing a character present in
pause_at_characters.Properties
The current line of dialogue. Setting this property automatically updates the text displayed in the label.
Whether the label is currently typing itself out. Read-only property that returns
false when typing is complete or when awaiting an inline mutation.Signals
spoke
letter- The character that was just typedletter_index- The index of the character in the textspeed- The current typing speed multiplier
skipped_typing
started_typing
finished_typing
Methods
type_out()
This method emits
started_typing and handles the typing animation automatically. If seconds_per_step is set to 0, all text will be displayed immediately.skip_typing()
skipped_typing.
Example:
Usage Example
Advanced Features
Custom Text Updates
You can override the_update_text() method in a subclass to customize how the label displays dialogue text:
Inline Mutations
DialogueLabel automatically handles inline mutations defined in your dialogue script. These mutations are executed at specific character positions during the typing animation, allowing for dynamic text effects and game state changes.
The label waits for inline mutations to complete before continuing to type, ensuring proper synchronization between text display and game logic.