spritespin icon indicating copy to clipboard operation
spritespin copied to clipboard

Animation spins really fast only on firefox, loads consistent speed on other browsers

Open BenComicGraphics opened this issue 3 years ago • 7 comments

I have a frametime of 3 set.

BenComicGraphics avatar Sep 28 '21 00:09 BenComicGraphics

A frame time of 3 means 3ms per frame which translates to 1000ms / 3ms = 333 frames per second. That is pretty fast. I suggest you limit the frameTime to something like 16.

Which version of SpriteSpin is this about? Up to Version 4.x.x spritespin used setTimeout for scheduling animation frames. setTimeout usually resolves after around 16ms, which caps the given 3ms to 16ms. So usually you cant go faster than ~60 fps. This however depends on the browser.

Since Version 5.0.0-beta1 SpriteSpin uses requestAnimationFrame to schedule the animation frames. In this case there is no 16ms cap.

giniedp avatar Sep 28 '21 06:09 giniedp

switched to https://unpkg.com/[email protected]/release/spritespin.js and it is still going super fast.

BenComicGraphics avatar Sep 28 '21 11:09 BenComicGraphics

Did you also change the frameTime to something around 16? If not, then this is to be expected.

giniedp avatar Sep 28 '21 12:09 giniedp

I did. Also using the Vue implimentation if that helps.

On Tue, Sep 28, 2021 at 7:26 AM Ginie @.***> wrote:

Did you also change the frameTime to something around 16? If not, then this is to be expected.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/giniedp/spritespin/issues/85#issuecomment-929155619, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOVFMIVPM3IFIMZHSOHHL3UEGYAHANCNFSM5E3ZRFGA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Ben Carver Web Developer

BenComicGraphics avatar Sep 28 '21 12:09 BenComicGraphics

i can not reproduce any issue. Can you show me your code or create a stackblitz example?

here is what i play around with https://stackblitz.com/edit/js-ifxqyd?file=index.html

you can increase the frame time with the + and - buttons

giniedp avatar Sep 28 '21 13:09 giniedp

Can you email me privately and I can send you a link to the live site?

On Tue, Sep 28, 2021 at 8:56 AM Ginie @.***> wrote:

i can not reproduce any issue. Can you show me your code or create a stackblitz example?

here is what i play around with https://stackblitz.com/edit/js-ifxqyd?file=index.html

you can increase the frame time with the + and - buttons

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/giniedp/spritespin/issues/85#issuecomment-929246115, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOVFMOJG3Y2Y6QNEA5QCVDUEHCSDANCNFSM5E3ZRFGA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Ben Carver Web Developer

BenComicGraphics avatar Sep 28 '21 14:09 BenComicGraphics

feel free to email me to the email address in my profile https://github.com/giniedp

giniedp avatar Sep 28 '21 15:09 giniedp