Add hover interaction to pause button

This commit is contained in:
Moe Poi ~ 2023-10-25 17:19:35 +07:00
parent b636c39334
commit e811a33464
2 changed files with 9 additions and 1 deletions

View file

@ -104,4 +104,6 @@ texture = ExtResource("3_r1i66")
layout_mode = 2
texture = ExtResource("3_r1i66")
[connection signal="mouse_entered" from="Pause/PauseButton" to="." method="_on_pause_button_hold"]
[connection signal="mouse_exited" from="Pause/PauseButton" to="." method="_on_pause_button_release"]
[connection signal="pressed" from="Pause/PauseButton" to="." method="_on_pause_button_pressed"]

View file

@ -15,3 +15,9 @@ func set_damage(value):
func _on_pause_button_pressed():
on_paused.emit()
func _on_pause_button_hold():
$Pause/PauseButton.modulate = Color(0.615686, 0.615686, 0.615686, 1)
func _on_pause_button_release():
$Pause/PauseButton.modulate = Color(1, 1, 1, 1)