forked from team-sg/hero-mark-2
3d text scene
This commit is contained in:
parent
762205b006
commit
d2a777f47c
3 changed files with 108 additions and 0 deletions
28
objects/hud/3d_text.gd
Normal file
28
objects/hud/3d_text.gd
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue