ld-56/components/Menu/populate_from_metadata.gd
2024-10-06 04:22:46 -04:00

13 lines
290 B
GDScript

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]]