added a talking rock
This commit is contained in:
9
Scripts/actionable.gd
Normal file
9
Scripts/actionable.gd
Normal file
@@ -0,0 +1,9 @@
|
||||
extends Area2D
|
||||
|
||||
|
||||
@export var dialouge_res: DialogueResource
|
||||
@export var dialouge_start: String = "start"
|
||||
|
||||
|
||||
func action() -> void:
|
||||
DialogueManager.show_example_dialogue_balloon(dialouge_res, dialouge_start)
|
21
Scripts/dialouge.gd
Normal file
21
Scripts/dialouge.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
extends CanvasLayer
|
||||
|
||||
@export(String, FILE, "*.json",) var d_file
|
||||
|
||||
var dia = []
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
start()
|
||||
|
||||
func start():
|
||||
dia = load_dialouge()
|
||||
$NinePatchRect/Title.text = dia[0]['name']
|
||||
$NinePatchRect/Title.text = dia[0]['text']
|
||||
|
||||
func load_dialouge():
|
||||
var file = file.new()
|
||||
|
||||
if file.file_exists(d_file):
|
||||
file.open(d_file, file.READ)
|
||||
return parse_json(file.get_as_text())
|
Reference in New Issue
Block a user