GodotProjects/Sprout/addons/dialogic/Events/Text/node_name_label.gd
2023-01-03 16:54:53 -07:00

19 lines
416 B
GDScript

extends Label
class_name DialogicNode_NameLabel
# If true, the label will be hidden if no character speaks.
@export var hide_when_empty := true
@export var use_character_color := true
func _ready():
add_to_group('dialogic_name_label')
text = ""
func _set(property, what):
if property == 'text' and typeof(what) == TYPE_STRING:
text = what
if hide_when_empty:
visible = !what.is_empty()
return true