Dialogue animation

This commit is contained in:
2ndbeam 2024-05-19 20:27:48 +03:00
commit 1cb2c7ebdb
2 changed files with 11 additions and 0 deletions

View file

@ -92,6 +92,8 @@ bbcode_enabled = true
text = "DIALOGUE_ENTRY_POINT" text = "DIALOGUE_ENTRY_POINT"
scroll_following = true scroll_following = true
selection_enabled = true selection_enabled = true
visible_characters = 0
visible_ratio = 0.0
[node name="Actions" type="NinePatchRect" parent="MenuBackground"] [node name="Actions" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0 layout_mode = 0

View file

@ -2,6 +2,15 @@ extends NinePatchRect
@onready var dialogue = $DialogueView @onready var dialogue = $DialogueView
func _ready():
var tween = create_tween() \
.tween_property(dialogue,"visible_ratio",1.0, 2)
print(len(dialogue.text))
func send_message(msg: Message): func send_message(msg: Message):
var new_msg = tr(msg.fact + "_RECEIVED") var new_msg = tr(msg.fact + "_RECEIVED")
var old_len = len(dialogue.get_parsed_text())
dialogue.append_text(new_msg) dialogue.append_text(new_msg)
dialogue.visible_characters = old_len
var tween = create_tween() \
.tween_property(dialogue,"visible_ratio",1.0, 2)