refactoring UI
This commit was merged in pull request #26.
This commit is contained in:
@@ -3,16 +3,21 @@ extends Control
|
||||
@onready var photo: Photo = $%Photo
|
||||
@onready var panel: Panel = $%Panel
|
||||
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
GameState.on_photo_highlighted.connect(_on_photo_highlighted)
|
||||
|
||||
func _on_photo_highlighted(texture: Texture) -> void:
|
||||
if texture != photo.texture_rect.texture:
|
||||
show()
|
||||
photo.scale = Vector2.ONE
|
||||
TweenFX.fold_in(photo)
|
||||
photo.setup(texture)
|
||||
|
||||
|
||||
func _on_panel_gui_input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
|
||||
await TweenFX.fold_out(photo).finished
|
||||
photo.texture_rect.texture = null
|
||||
hide()
|
||||
|
||||
Reference in New Issue
Block a user