You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
341 B
14 lines
341 B
3 weeks ago
|
@tool
|
||
|
extends Button
|
||
|
|
||
|
@export var on_texture : Texture2D
|
||
|
@export var off_texture : Texture2D
|
||
|
@export var modifier_key : Key
|
||
|
|
||
|
func _toggled(on: bool) -> void:
|
||
|
icon = on_texture if on else off_texture
|
||
|
|
||
|
func _input(event: InputEvent) -> void:
|
||
|
if event is InputEventKey and event.keycode == modifier_key:
|
||
|
button_pressed = !button_pressed
|