How to slow down sprite animation (frame rate)

I have this sprite:

sprite = new Sprite({
image: 'player.png' cols: 8, rows: 8,
animations: {
up: [0, 3], right: [4, 7], down: [8, 11], left: [12, 15],
},
});

and i run it using:

sprite.run({ label: animName, time: time, loop: true });

Im trying to "slow down" the animation, and I don't quite understand how to do that using the "time" argument...
I'm looking for a way to set "frame duration time" or FPS for sprite (not tween).

Another solution would be to set animation using frame index like so:

up: [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3,]

But that doesn't seem to work either...

Also, where do I set the FPS for ZIM to run (30 / 60 / 24) if there's such an option?

Ticker.setFPS(15); 
// but slows things down for anything in that frame

I would not think there would be an issue with slowing down a sprite just using time. Just set it t a time of 3 and if you want it faster, set it at 2.5, if you want it slower set it at 3.5, etc. Any time with any decimal or not is fine.

1 Like