I made a dialog system based on this youtube guide. I need help to modify it and make it more flexible to use. Specific tasks I want to do are to make PART of the text in red jittery letters at any time, or to stop printing at a moment's notice, or to make the text window invisible at a similar moment's notice. I'd like to get ideas on this, because I haven't finalized anything myself yet. Thank you in advance
https://www.youtube.com/watch?v=GzPvN5wsp7Y&ab_channel=Afely
#Dialog window
6 messages · Page 1 of 1 (latest)
Taking inspiration from 2019's hit indie game A Short Hike, let's make a very clean and easy textbox. All we need is a textbox scene and a dialog manager to get talking NPCs for our Godot indie game. :)
🎵 Tropicala - ConcernedApe
🎵 The Sun Can Bend an Orange Sky - ConcernedApe
Hello, please help me with the code. In the match text area I want to add "$":, which will be responsible for the fact that the text from letter A to letter B will be red, the text itself is set through const lines: Array[String] = {"Text1"}, let's say it will be {"$Text1$"}, which will make all the text red, but the symbol $ itself will not be visible and will not take up space, ie in its place there will be no space. Thank you in advance
func _display_letter():
label.text += text[letter_index]
letter_index += 1
if letter_index >= text.length():
finished_displaying.emit()
return
match text[letter_index]:
"!", ".", ",", "?":
timer.start(punctuation_time)
"":
timer.start(space_time)
_:
timer.start(letter_time)
var new_audio_player = audio_player.duplicate()
new_audio_player.pitch_scale += randf_range(-0.1, 0.1)
if text[letter_index] in ["a", "e", "i", "o", "u"]:
new_audio_player.pitch_scale += 0.2
get_tree().root.add_child(new_audio_player)
new_audio_player.play()
await new_audio_player.finished
new_audio_player.queue_free()
Theres a thing in godot that can do exactly what you want, if i understood you correctly. It's called bbcode. You can enable it in any richtextlabel, and it allows you to do all kinds of fancy visual effects. Just insert blocks like [wave][/wave]. So for example, in the text "Hi, it's just [wave]wonderful[/wave] to meet you!" The word "wonderful" would be wiggling. Theres a bunch of different options that are all pretty fun to play around with, including stuff like color changing and jittering, like you mentioned. You can read more about the different kinds of effects here: https://docs.godotengine.org/en/stable/tutorials/ui/bbcode_in_richtextlabel.html
Godot Engine documentation
Introduction: Label nodes are great for displaying basic text, but they have limitations. If you want to change the color of the text, or its alignment, you can only do that to the entire label. Yo...
Thank you, you've been very helpful, here's the result