Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FPS not working correctly #10

Open
PierBover opened this issue Mar 30, 2015 · 1 comment
Open

FPS not working correctly #10

PierBover opened this issue Mar 30, 2015 · 1 comment

Comments

@PierBover
Copy link

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)

sprite-mano-click

@blaiprat
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants