added text input, started adding label button

This commit is contained in:
2026-06-10 06:01:03 -05:00
parent 6c38b05832
commit 2e31012447
27 changed files with 163 additions and 19 deletions

View File

@@ -0,0 +1,35 @@
extends StaticBody3D
var baseColor : Color
var pressedColor : Color
@onready var Animator = $Animator
var pressed : bool = false
var ButtonMaterial : StandardMaterial3D = StandardMaterial3D.new()
func _initButton(BaseColor:Color,PressedColor:Color,char:String):
baseColor=BaseColor
pressedColor=PressedColor
ButtonMaterial.albedo_color = BaseColor
$Label3D.text = char
func _ready() -> void:
$MeshRoot.material_override = ButtonMaterial
ButtonMaterial.albedo_color = baseColor
Animator.get_animation("interact").loop_mode = Animation.LOOP_NONE
func press():
if !pressed:
$"..".buttonPressed.emit($Label3D.text)
$"..".buttonUpdated.emit()
Animator.play("interact")
ButtonMaterial.albedo_color = pressedColor
pressed=true
func release():
if pressed:
$"..".buttonReleased.emit()
$"..".buttonUpdated.emit()
Animator.play_backwards("interact")
ButtonMaterial.albedo_color = baseColor
pressed=false