summaryrefslogtreecommitdiffstats
path: root/touch_screen_button.gd
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-11-22 09:56:30 +0200
committerJan Tuomi <jan@jantuomi.fi>2025-11-22 09:56:47 +0200
commit5c726e339a56113878073aa1929d007d052c8a8b (patch)
treec3bf876a2042f401db61c61e7cc2e6a09b7cb60a /touch_screen_button.gd
parentba7899742388e6cf33bcb85c42b9cd0855c4896a (diff)
Fix touchscreen button highlight bug
Diffstat (limited to 'touch_screen_button.gd')
-rw-r--r--touch_screen_button.gd8
1 files changed, 5 insertions, 3 deletions
diff --git a/touch_screen_button.gd b/touch_screen_button.gd
index b607964..d45098a 100644
--- a/touch_screen_button.gd
+++ b/touch_screen_button.gd
@@ -5,11 +5,13 @@ extends TouchScreenButton
@export var active_color: Color
func _ready() -> void:
+ connect("pressed", _on_pressed)
+ connect("released", _on_released)
$TextureRect.texture = texture
- $TextureRect/CanvasModulate.color = inactive_color
+ $TextureRect.modulate = inactive_color
func _on_pressed() -> void:
- $TextureRect/CanvasModulate.color = active_color
+ $TextureRect.modulate = active_color
func _on_released() -> void:
- $TextureRect/CanvasModulate.color = inactive_color
+ $TextureRect.modulate = inactive_color