immersive-home/content/ui/entity/entity.gd

15 lines
311 B
GDScript3
Raw Normal View History

2023-10-30 02:21:50 +02:00
extends StaticBody3D
@onready var label: Label3D = $Label
@export var text = "Default"
2023-10-30 02:21:50 +02:00
signal click(name: String)
2023-11-05 22:32:50 +02:00
func _on_click(event):
click.emit(text)
2023-10-30 02:21:50 +02:00
func set_entity_name(text):
assert(label != null, "Entity has to be added to the scene tree")
label.text = text.replace(".", "\n")
self.text = text