18 lines
477 B
GDScript
18 lines
477 B
GDScript
extends RichTextLabel
|
|
|
|
var text_to_scroll = self.text
|
|
|
|
func _ready() -> void:
|
|
scroll_text(text_to_scroll)
|
|
|
|
func scroll_text(input_text: String) -> void:
|
|
visible_characters = 0
|
|
var current_line = get_character_line(visible_characters)
|
|
text = input_text
|
|
|
|
for i in get_parsed_text():
|
|
visible_characters += 1
|
|
if current_line != get_character_line(visible_characters):
|
|
current_line = get_character_line(visible_characters)
|
|
await get_tree().create_timer(1.0).timeout
|