forked from team-sg/hero-mark-2
32 lines
692 B
GDScript
32 lines
692 B
GDScript
tool
|
|
extends ViewportContainer
|
|
|
|
|
|
export var text: String = "" setget _set_text
|
|
export var text_material: Material = null setget _set_material
|
|
|
|
|
|
onready var text_mesh = $"%TextMesh"
|
|
onready var animation_player = $"%AnimationPlayer"
|
|
export var anim = "RESET"
|
|
|
|
func _ready() -> void:
|
|
animation_player.play(anim)
|
|
|
|
|
|
func _set_text(value: String) -> void:
|
|
text = value
|
|
if not is_instance_valid(text_mesh):
|
|
yield(self, "ready")
|
|
text_mesh.mesh.text = text
|
|
|
|
|
|
func _set_material(value: Material) -> void:
|
|
text_material = value
|
|
if not is_instance_valid(text_mesh):
|
|
yield(self, "ready")
|
|
text_mesh.mesh.material = text_material
|
|
|
|
|
|
func play_confirm_sound():
|
|
pass # Replace with function body.
|