Files
tgcc/core/game_menu/option_menu_button.gd
2026-05-14 22:31:37 +02:00

19 lines
444 B
GDScript

@tool
extends Control
signal on_button_pressed
@export var image: Texture:
set(value):
image = value
if is_inside_tree() and has_node("%Texture"):
$%Texture.texture = image
func _ready():
if image != null and has_node("%Texture"):
$%Texture.texture = image
func _on_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
on_button_pressed.emit()