add fps to loadAnimatedGraphic (#626)

* add fps to loadAnimatedGraphic

wow and it doesn't even break old mods :0

* you'll float too

hi georgie
This commit is contained in:
Microkat
2025-05-02 23:15:36 +02:00
committed by GitHub
parent 31ae98fe44
commit 98da050c17
+2 -2
View File
@@ -609,11 +609,11 @@ class CoolUtil
* @param spr Sprite to load the graphic for
* @param path Path to the graphic
*/
public static function loadAnimatedGraphic(spr:FlxSprite, path:String) {
public static function loadAnimatedGraphic(spr:FlxSprite, path:String, fps:Float = 24.0) {
spr.frames = Paths.getFrames(path, true);
if (spr.frames != null && spr.frames.frames != null) {
spr.animation.add("idle", [for(i in 0...spr.frames.frames.length) i], 24, true);
spr.animation.add("idle", [for(i in 0...spr.frames.frames.length) i], fps, true);
spr.animation.play("idle");
}