godot-vn/dialog_layer.gd

36 lines
718 B
GDScript3
Raw Normal View History

2018-09-21 02:43:57 +01:00
extends CanvasLayer
export (String, FILE, "*.txt") var dialog_path;
onready var dialog_box = get_node("dialog_box")
func _ready():
# start signal
get_parent().connect("on_scene_ready", self, "_on_scene_ready")
2018-09-21 03:54:04 +01:00
get_parent().connect("on_scene_start", self, "_on_scene_start")
2018-09-21 02:43:57 +01:00
dialog_box.connect("on_dialog_init", self, "_on_dialog_init")
dialog_box.connect("on_dialog_completed", self, "_on_dialog_completed")
# set up params
dialog_box.set_dialog_path(dialog_path)
2018-09-21 03:11:14 +01:00
2018-09-21 02:43:57 +01:00
2018-09-21 03:11:14 +01:00
func _on_scene_ready():
2018-09-21 02:43:57 +01:00
# init after yes
dialog_box.initialize_dialog()
2018-09-21 03:54:04 +01:00
func _on_scene_start():
2018-09-21 03:11:14 +01:00
# then entero
2018-09-21 02:43:57 +01:00
dialog_box.enter_frame()
2018-09-21 03:11:14 +01:00
2018-09-21 02:43:57 +01:00
func _on_dialog_init(d):
pass
func _on_dialog_completed(d):
dialog_box.exit_frame()