Made dialog a separate view
This commit is contained in:
27
portrait.gd
Normal file
27
portrait.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
extends Node2D
|
||||
|
||||
@onready var animplayer:AnimationPlayer = $SubViewport/Fade/AnimationPlayer
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
$CanvasLayer.hide()
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
func say(line):
|
||||
if !$CanvasLayer.visible:
|
||||
animplayer.play("fade_in")
|
||||
await get_tree().process_frame
|
||||
$CanvasLayer.show()
|
||||
|
||||
await animplayer.animation_finished
|
||||
$"SubViewport/talk-label".text = line
|
||||
|
||||
func done_say():
|
||||
$"SubViewport/talk-label".text = ""
|
||||
animplayer.play_backwards("fade_in")
|
||||
await animplayer.animation_finished
|
||||
$CanvasLayer.hide()
|
||||
Reference in New Issue
Block a user