Adjusting gavel animation player

This commit is contained in:
vandomej 2025-10-05 19:44:12 -07:00
parent 5601b8b7c3
commit f740d83dcc
2 changed files with 6 additions and 7 deletions

View file

@ -86,7 +86,7 @@ animations = [{
}], }],
"loop": false, "loop": false,
"name": &"Hover", "name": &"Hover",
"speed": 24.0 "speed": 15.0
}, { }, {
"frames": [{ "frames": [{
"duration": 1.0, "duration": 1.0,
@ -117,7 +117,7 @@ animations = [{
}], }],
"loop": false, "loop": false,
"name": &"Press", "name": &"Press",
"speed": 24.0 "speed": 20.0
}, { }, {
"frames": [{ "frames": [{
"duration": 1.0, "duration": 1.0,
@ -140,7 +140,7 @@ animations = [{
}], }],
"loop": false, "loop": false,
"name": &"Unhover", "name": &"Unhover",
"speed": 20.0 "speed": 15.0
}] }]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8sdgr"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8sdgr"]
@ -174,10 +174,8 @@ volume_db = 3.0
[node name="GavelAnimations" type="AnimatedSprite2D" parent="Gavel"] [node name="GavelAnimations" type="AnimatedSprite2D" parent="Gavel"]
position = Vector2(240, 210) position = Vector2(240, 210)
sprite_frames = SubResource("SpriteFrames_g470s") sprite_frames = SubResource("SpriteFrames_g470s")
animation = &"Unhover" animation = &"Press"
autoplay = "Idle" autoplay = "Idle"
frame = 5
frame_progress = 1.0
[node name="Numpad" type="Node2D" parent="." node_paths=PackedStringArray("progress_bar", "reminder_timer", "error_audio_player", "success_audio_player")] [node name="Numpad" type="Node2D" parent="." node_paths=PackedStringArray("progress_bar", "reminder_timer", "error_audio_player", "success_audio_player")]
position = Vector2(640, 570) position = Vector2(640, 570)

View file

@ -32,13 +32,14 @@ func _on_texture_button_button_down() -> void:
audio_player.play() audio_player.play()
gavel_hit.emit() gavel_hit.emit()
$GavelAnimations.play("Press") $GavelAnimations.play("Press")
func _on_texture_button_mouse_entered() -> void: func _on_texture_button_mouse_entered() -> void:
$GavelAnimations.play("Hover") $GavelAnimations.play("Hover")
func _on_texture_button_mouse_exited() -> void: func _on_texture_button_mouse_exited() -> void:
#if $TextureButton.pressed: #if $TextureButton.pressed:
$GavelAnimations.play("Unhover") $GavelAnimations.play("Unhover")
await $GavelAnimations.animation_finished
$GavelAnimations.play("Idle") $GavelAnimations.play("Idle")
#else: #else:
#$GavelAnimations.play("Hover", -1.0) #$GavelAnimations.play("Hover", -1.0)