3d text scene

This commit is contained in:
Haze Weathers 2023-09-09 13:02:01 -04:00
parent 762205b006
commit d2a777f47c
3 changed files with 108 additions and 0 deletions

28
objects/hud/3d_text.gd Normal file
View file

@ -0,0 +1,28 @@
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"
func _ready() -> void:
pass
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