gmtk2021/Scripts/PersonRoot.gd

34 lines
813 B
GDScript3

extends Node2D
class_name PersonRoot
export var description_untyped : Resource
var description : Description
var descriptionPane : DescriptionPane
#onready var body : PersonBody = $PersonBody
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
description = description_untyped
descriptionPane = get_parent().get_node("DescriptionPane")
pass
func start_display():
descriptionPane.fill(description.name, description.subtitle, description.getTraitString())
descriptionPane.show()
func stop_display():
descriptionPane.hide()
func check_traits() -> bool:
return description.check_traits(self)
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass