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

change fps, start frame, end frame dynamically #26

Closed
nikitapilgrim opened this issue Oct 16, 2019 · 4 comments
Closed

change fps, start frame, end frame dynamically #26

nikitapilgrim opened this issue Oct 16, 2019 · 4 comments

Comments

@nikitapilgrim
Copy link

I need to change dynamically sprites on an element, including FPS.
SetFPS function does not work
I understand that the values are initialized when the component is mounted and I can’t change them dynamically, how best to implement this? I can change the start and end frames, but I can’t change the FPS

@danilosetra
Copy link
Owner

Hi @nikitapilgrim !

Yes, it's possible to change the FPS and other parameters even after initialization.

For changing the FPS, I've made a quick example on this link, where you click the buttons to change the FPS:
https://stackblitz.com/edit/react-responsive-spritesheet-example-03-g19qwd?file=index.js

I've noticed you wrote SetFPS, but the function is SetFps. It's case sensitive.

If you have any questions, please send me the piece of code where you're trying to change it, maybe I can help you.

Cheers.

@nikitapilgrim
Copy link
Author

this.setIntervalPlayFunctions is not a function error
image

@nikitapilgrim
Copy link
Author

setEndAt work, but setFps not work

@TiyaFil
Copy link

TiyaFil commented Mar 6, 2024

This project is great, thanks for sharing.

It may sound strange, and I, of course, look like a necromancer now.... but the setFps function doesn’t really work. Or both Nikita and I are doing something wrong. Everything works perfectly on the stackblitz, but on the local machine it doesn’t work. Still the same error "setIntervalPlayFunctions is not a function".

Help me please. I'm stuck.

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

3 participants