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

goto delta time (question not issue)? #64

Closed
macguffin opened this issue Nov 2, 2015 · 13 comments
Closed

goto delta time (question not issue)? #64

macguffin opened this issue Nov 2, 2015 · 13 comments

Comments

@macguffin
Copy link

Hi not really an issue just a question. Is there a way to jump to a specific time/delta. I'm looking in the AnimationState.js but can't see what to use.

Thanks

@ivanpopelyshev
Copy link
Collaborator

Something like that:

spine.state.tracks[0].time = ...
spine.state.update(0);

may be

spine.update(0)

I'm not sure :)

@macguffin
Copy link
Author

Thanks for the pointer. :)
On Mon, 2 Nov 2015 at 09:50, Ivan Popelyshev notifications@github.com
wrote:

Something like that:

spine.state.tracks[0].time = ...
spine.state.update(0);


Reply to this email directly or view it on GitHub
#64 (comment).

@macguffin
Copy link
Author

spine.state.tracks[0].time is null in this animation. I've just cloned the repository so I will have a look round.

Do you have any idea what happens if animating on a crappy device, will frames be skipped?

I'm basically using events to drive other bits of code and and wondering if there is a possibility that these events could be missed, or skipped over.

The gotoAndStop(time or frame) would be a safety measure to force the animation to the correct frame when it has finished.

Thanks

@ivanpopelyshev
Copy link
Collaborator

Did you start the animation first?

state.setAnimationByName(0, "animation1", true);

@ivanpopelyshev
Copy link
Collaborator

Events wont be missed, that's for sure.

@macguffin
Copy link
Author

That's great to know!

@macguffin
Copy link
Author

I am starting the animation just not looping it

state.setAnimationByName(0, "animation1", false);

@ivanpopelyshev
Copy link
Collaborator

When animation is complete, tracks[0] will dissappear. Are you sure that tracks[0] is defined when you do that thing with time?

@macguffin
Copy link
Author

Ok that will be what it is.

I think maybe I'm being over cautious. If events will definitely fire and the animation will always show its final frame that should be enough.

When I used another spine runtime with createjs in the past I had an issue with a frame not being shown correctly when stopping the animation. I would have to manually set the delta time to be sure. I haven't had anything like that with your stuff.

Thanks for your help and your time.
BTW do you have an official forum for these sorts of questions?

@ivanpopelyshev
Copy link
Collaborator

Posting the issue here is fastest way of finding solution for your problem :)

Pixijs subforum on html5gamedevs: http://www.html5gamedevs.com/forum/15-pixijs/

@macguffin
Copy link
Author

Thanks

Last question I promise :)

Can you pause the animation via an event?
Is there something that would do the equivalent of:

spine.state.pause();

@ivanpopelyshev
Copy link
Collaborator

spine.autoUpdate = false;

stops all animations.

You can update them manually by using

spine.update(dt); //dt is in millis

@macguffin
Copy link
Author

Awesome thanks very much that is just what I need.

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