Jump to content

Can I reset a spine animation to the first frame


mkit
 Share

Recommended Posts

I am developing a game that uses spine animations

 

I have successfully managed to get the animations playing either just once or looping as follows:

 

Play once

------------

 

rabbit.state.setAnimationByName("animation", false);

 

Looping

----------

rabbit.state.setAnimationByName("animation", true);

 

Is there a command to make the animation go back to frame 1. I would like to reset the animation to the first frame once the user clicks on a button.

 

I also need to know when the animation has finished playing - is there any way to add a listener to detect when it reaches the final frame of the animation?

 

If there is a list of all the commands available for Spine animations that would be really helpful.

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...