extends Control

class_name Photo

@onready var texture_rect: TextureRect = $%PhotoTexture

func setup(texture: Texture) -> void:
	if texture:
		if !texture_rect:
			texture_rect = $%PhotoTexture
		texture_rect.texture = texture


func _on_gui_input(event: InputEvent) -> void:
	if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
		GameState.on_photo_highlighted.emit(texture_rect.texture)
