From 5c726e339a56113878073aa1929d007d052c8a8b Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sat, 22 Nov 2025 09:56:30 +0200 Subject: Fix touchscreen button highlight bug --- touch_screen_button.gd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'touch_screen_button.gd') 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 -- cgit v1.3