summaryrefslogtreecommitdiffstats
path: root/touch_screen_button.gd
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-11-14 10:16:53 +0200
committerJan Tuomi <jan@jantuomi.fi>2025-11-14 10:16:53 +0200
commit5afd1a00a58d53c56ecc003ff0705c0a8773b19f (patch)
tree822eb4a936d72bcd9388fb25ea8f28f622f96b7c /touch_screen_button.gd
parentc79b722af2a5cf733a09048e3c0eddcf0533bcfc (diff)
Add touchscreen button icons
Diffstat (limited to 'touch_screen_button.gd')
-rw-r--r--touch_screen_button.gd14
1 files changed, 14 insertions, 0 deletions
diff --git a/touch_screen_button.gd b/touch_screen_button.gd
new file mode 100644
index 0000000..a03376d
--- /dev/null
+++ b/touch_screen_button.gd
@@ -0,0 +1,14 @@
+extends TouchScreenButton
+
+@export var texture: Texture2D
+
+# Called when the node enters the scene tree for the first time.
+func _ready() -> void:
+ $TextureRect.texture = texture
+ if not DisplayServer.is_touchscreen_available():
+ visible = false
+
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+func _process(_delta: float) -> void:
+ pass