32 lines
688 B
GDScript
32 lines
688 B
GDScript
extends Control
|
|
|
|
var balloon: Node
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
self.hide()
|
|
|
|
|
|
|
|
func start_balloon(dialogue_resource: Resource, start_title: String):
|
|
|
|
#Freeing Previous Balloon and Disconnecting DialogueManager signals
|
|
clean_balloon()
|
|
|
|
#Instantiating a custom balloon
|
|
var balloon_path = "res://Dialogues/balloon_big.tscn"
|
|
var Balloon: Resource = load(balloon_path)
|
|
balloon = Balloon.instantiate()
|
|
get_tree().current_scene.add_child(balloon)
|
|
|
|
#Starting dialogue
|
|
balloon.start(dialogue_resource, start_title)
|
|
|
|
|
|
|
|
func clean_balloon():
|
|
|
|
#Freeing Previous Balloon
|
|
if is_instance_valid(balloon):
|
|
balloon.queue_free()
|