working on touch_controls visible on touch, hide on key

This commit is contained in:
Harmony Honey Monroe 2025-02-28 03:49:47 -05:00
parent dc96e13e19
commit d5259f7ad9

View file

@ -16,6 +16,12 @@ func _ready():
visible = (OS.has_touchscreen_ui_hint() and OS.get_name() == "HTML5") or OS.get_name() == "Android"
vis()
func _input(event):
if event is InputEventScreenTouch or event is InputEventScreenDrag:
visible = true
elif event is InputEventKey or event is InputEventJoypadButton or event is InputEventJoypadMotion:
visible = false
func vis():
if is_instance_valid(UI.keys_node):
UI.keys_node.visible = !visible