ld-56/components/Menu/populate_from_metadata.gd

14 lines
290 B
GDScript3
Raw Normal View History

2024-10-06 08:22:46 +00:00
extends RichTextLabel
@export var key := ""
@export var alignment := "center"
var _data
func _ready() -> void:
if get_tree().root.has_node("Data"):
_data = get_tree().root.get_node("Data")
if _data.data.has("metadata"):
text = "[%s]%s" % [alignment, _data.data.metadata[key]]