First step: Make a text box, and characters display themselves one by one.
while rich_label.visible_ratio < 1.0:
rich_label.visible_characters += 1
await get_tree().create_timer(0.3).timeout
This should do.
Second: Makes it so that text goes faster while holding button.
while rich_label.visible_ratio < 1.0:
rich_label.visible_characters += 1
var char_gap: float = 0.5 - (0.4 * int(Input.is_action_pressed("ui_confirme")))
await get_tree().create_timer(char_gap).timeout
This would work.
Third: Makes it go faster or slower on commend, for example:
“[char_gap=.8]I’m now talking…[char_gap=.1]REALLY FAST!!!”
Annnnnd I have no idea how to do that.
How does apps reads bbcode anyway? Do they instantly check for close bracket when they see an open one?
It’s still on theory crafting stage, just looking for some general direction guidance so I can start easier.
You may have to parse the dialogue for custom commands that cannot be handled by bbcodes. This type-writer effect might be possible through a custom bbcode/RichTextEffect.
I would recommend using a Timer node instead of create_timer so often
Well, this works…Though I’m not sure how do I add sfx, and how do I change speed mid sentence since all characters process individually and timing would mess up.
This is a direction I can work with, so thanks for suggestion.