This is a simple RichTextLabel extension for displaying dynamic dialogues.
Dialogue Label is in testing. Bugs may appear, so feel free to open Issues and give feedback.
[spd 1.5]
change text speed to 1.5 symbols/frame
[inst 5]
instantly display next 5 symbols
[snd 0]
choose first sound bite in sound bite list
[snd -1]
turn off sound bite
[wait 60]
- delay for 60 frames
these tags should not be closed
you don't have to use spd and snd tags in beginning of each message. These properties are persistent.
[color=gray][inst 13]!!!warning!!![/color]
[spd 1.5][snd 0]fast text with... [wait 60]sound bite 0
[spd 0.1][snd -1]slow text without sound bite
signal | meaning |
---|---|
dialogue_started | emits when dialogue starts |
message_next | emits at the beginning of message rendering |
dialogue_ended | emits when dialogue ends |
message_finished | emits in the end of message rendering |
variable | meaning |
---|---|
messages | array of strings to display |
sound_files | array of sound bite files, used in [snd] tag |
text_speed | default speed of text |
active | current state of typing |
message_id | index of current message |
function | meaning |
---|---|
get_current_message() | returns current message with all tags |
stop_dialogue() | stops rendering of dialogue |
change_messages(Array) | changes messages. Also resets message_id to 0 |
start_dialogue() | starts the dialogue |
next_message() | renders next message |
skip_message() | displays current message instantly |
Malformed bbcode tags may lead to bugs. Be sure to use square brackets only for valid tags.