refactoring UI
This commit was merged in pull request #26.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
extends Control
|
||||
extends Button
|
||||
|
||||
class_name Photo
|
||||
|
||||
@@ -11,6 +11,20 @@ func setup(texture: Texture) -> void:
|
||||
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)
|
||||
func _on_pressed() -> void:
|
||||
if TweenFX.is_playing(self, TweenFX.Animations.PUNCH_IN):
|
||||
return
|
||||
TweenFX.punch_in(self)
|
||||
GameState.on_photo_highlighted.emit(texture_rect.texture)
|
||||
|
||||
|
||||
|
||||
func _on_mouse_entered() -> void:
|
||||
if TweenFX.is_playing(self, TweenFX.Animations.BREATHE):
|
||||
return
|
||||
TweenFX.breathe(self, 1)
|
||||
|
||||
|
||||
func _on_mouse_exited() -> void:
|
||||
TweenFX.stop(self, TweenFX.Animations.BREATHE)
|
||||
scale = Vector2(1, 1)
|
||||
|
||||
Reference in New Issue
Block a user