From 6824649c8961b8aa695b6be805401fa357a61793 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 21 Nov 2025 21:38:49 +0200 Subject: Improve map --- touch_screen_button.gd | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'touch_screen_button.gd') diff --git a/touch_screen_button.gd b/touch_screen_button.gd index 1a84776..b607964 100644 --- a/touch_screen_button.gd +++ b/touch_screen_button.gd @@ -1,10 +1,15 @@ extends TouchScreenButton @export var texture: Texture2D -@export var desktop_visible: bool +@export var inactive_color: Color +@export var active_color: Color -# 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 = desktop_visible + $TextureRect/CanvasModulate.color = inactive_color + +func _on_pressed() -> void: + $TextureRect/CanvasModulate.color = active_color + +func _on_released() -> void: + $TextureRect/CanvasModulate.color = inactive_color -- cgit v1.3