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

Get the current frame #9

Open
mmind-hub opened this issue Feb 26, 2015 · 3 comments
Open

Get the current frame #9

mmind-hub opened this issue Feb 26, 2015 · 3 comments

Comments

@mmind-hub
Copy link

Hi, great plugin !
I need play animations dynamically, for rollovers/rollout animations.
The problem is when i rollout i don't want my rollout animation to play from the start but from the current frame for a nice animation.
With the current frame i could edit the rollout animation.

For exemple to be clear : var spriteSettings = {
fps: currentFps,
loop: false,
autoplay: false,
animations: {
walkLeft: [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],
walkRight: [24,23,22,21,20,19,18,17,16,15, 14, 13, 12, 11, 10, 9, 8,7,6,5,4,3,2,1,0]
}
};

If i play the walkRight animation before walkLeft is finished, let's say at frame 17, i don't want walkRight to play from 24 but from the frame 17.

Any idea how to do that ?
Thanks again !

@blaiprat
Copy link
Owner

blaiprat commented Mar 5, 2015

To do what you want you need to know the current animation frame, but with the current version of the plugin there's no way to read the value from outside the plugin.

I'll try to release a new version so you'll be able to retrieve the animation and have some logic to handle your transition exactly how you want it.

@mmind-hub
Copy link
Author

Thank's !

@blaiprat
Copy link
Owner

Even if it's not ready for production yet, you might want to look at this new version of animatesprite. It's vanilla javascript but it should play nice with jQuery objects:

https://github.com/blaiprat/animateSprite

Hopefully this weekend I'll have some time to prepare a proper release (0.1.0).

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