summaryrefslogtreecommitdiffstats
path: root/touch_screen_button.gd
blob: d45098af0dcc7583ed7841c769860b670787d0f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extends TouchScreenButton

@export var texture: Texture2D
@export var inactive_color: Color
@export var active_color: Color

func _ready() -> void:
	connect("pressed", _on_pressed)
	connect("released", _on_released)
	$TextureRect.texture = texture
	$TextureRect.modulate = inactive_color

func _on_pressed() -> void:
	$TextureRect.modulate = active_color

func _on_released() -> void:
	$TextureRect.modulate = inactive_color