Skip to content

Commit 6700af9

Browse files
authored
Add FPS parameter to play animation (#14)
1 parent 555b0d7 commit 6700af9

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

LPCScreenshot.png

170 KB
Loading

addons/LPCAnimatedSprite/LPCAnimatedSprite2D.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ func _ready():
3939
if Engine.is_editor_hint() == false:
4040
LoadAnimations()
4141

42-
func play(animation: LPCAnimation):
42+
func play(animation: LPCAnimation, fps: float = 5.0):
4343
var sprites = get_children() as Array[AnimatedSprite2D]
4444
for sprite in sprites:
4545
if sprite.sprite_frames.has_animation(AnimationNames[animation]):
4646
sprite.visible = true
47+
sprite.sprite_frames.set_animation_speed(AnimationNames[animation], fps)
4748
sprite.play(AnimationNames[animation])
4849
else:
4950
sprite.visible = false

addons/LPCAnimatedSprite/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="LPCAnimatedSprite"
44
description=""
55
author="Alexandro Trevisan"
6-
version="4.1.2.4"
6+
version="4.1.3.1"
77
script="LPCAnimatedSprite.gd"

0 commit comments

Comments
 (0)