2024-12-19 19:13:12 +08:00
|
|
|
extends Button
|
2024-12-17 18:21:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
@export var TextureNormal:Texture2D
|
|
|
|
|
|
|
|
@export var TextureSelected:Texture2D
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var is_select:bool=false:
|
|
|
|
set(value):
|
|
|
|
if value:
|
|
|
|
$TextureRect.texture=TextureSelected
|
|
|
|
else:
|
|
|
|
$TextureRect.texture=TextureNormal
|
|
|
|
is_select=value
|
|
|
|
func _ready() -> void:
|
|
|
|
self.focus_mode=Control.FOCUS_NONE
|
2024-12-19 19:13:12 +08:00
|
|
|
self.button_down.connect(_button_down)
|
|
|
|
self.button_up.connect(_button_up)
|
|
|
|
func _button_down():
|
|
|
|
is_select=true
|
|
|
|
|
|
|
|
func _button_up():
|
|
|
|
is_select=false
|