jquery.animateSprite
jquery.animateSprite copied to clipboard
FPS not working correctly
I'm using 30 FPS but it seems animateSprite is skipping frames.
This is my code
$('#handClicker').animateSprite({
fps: 30,
loop: true,
animations:{
clicker:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59]
}
});
This is the css
#spriteManoClick {
width: 150px;
height: 150px;
background-image: url(sprite-mano-click.png);
}
And this is the image (it's a white hand)
This might be caused because the script is not using requestAnimationFrame, just a generic setTimeout to handle the frames. This might cause the browser to drop frames.
I'm working in a new version of the plugin using vanilla javascript. I've opened a ticket there, and I hope this next weekend It will be ready for use.