update ai, audio, menu
This commit is contained in:
22
core/main_scene_ui/icon_button.gd
Normal file
22
core/main_scene_ui/icon_button.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
@tool
|
||||
extends Control
|
||||
|
||||
class_name IconButton
|
||||
|
||||
signal on_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_pressed.emit()
|
||||
Reference in New Issue
Block a user