mirror of
https://github.com/HarmonyHoney/tiny_crate.git
synced 2026-01-23 02:34:53 +00:00
working on touch_controls visible on touch, hide on key
This commit is contained in:
parent
dc96e13e19
commit
d5259f7ad9
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue