Jump to content

Please help with tweening between keyframes


Recommended Posts

Firstly, thank you for making this great tool. Can't wait to use it in my own games!

I'm trying to do a cocos2d-x renderer for Spriter, I got it working with the monster example but I had some problems with tweening with the hero one.

When I looked at the XML file of the hero example, I noticed from one keyframe to the next keyframe, for the same object_ref id, the timeline could be different. How am I supposed to handle the tweening here?

Just as an example, as shown in the following, for object_ref id=14, in keyframe 4, the timeline is 14. But in keyframe 5, for same object_ref id points to timeline 20. The two different timeline points to 2 different images.

Thank you!

Link to comment
Share on other sites

This sounds like the feature of that particular character which I mentioned here viewtopic.php?f=2&t=3&p=1571#p1571 When there is a switch of sprite Spriter seems to keep the old sprite in its last defined position for the whole of the period between the two frames, then on the second frame switch the sprites. If you run the animation slowly you will see the hero's hand *seems* to slide along the sword. It isn't really, it is just staying still while the sword tweens and then hand sprite switches over on the next key frame. Similar things happen with the foot swapping from straight to bent.

Apparently it will be possible to group sprites so they are on the same timeline, but then we'll have other changes to look out for (same timeline number but change of sprite I presume).

Link to comment
Share on other sites

  • 3 weeks later...

sorry for the late reply. In the previous version of Spriter (which the knight character was saved under) used the beta format of scml which had no tweening. When you import it into the current Spriter, it asks if you want it to guess the tweening info. It only tweens objects using the same exact image on each frame. So when the hand changes images, it doesn't know it should be tweened.

Thus far there are some features of the persistent palette object window we haven't discussed yet, that can help you fix these import tweens.

If you go to the persistent object palette (on the right side of the screen by default), and uncheck "only show unused persistent objects" you will see a list of all persistent objects in the character. Persistent objects are just things like tweened sprites that exist on more than one frame. If you drag an image like the hair sprite onto a different hair sprite (you can do it again with the third hair sprite). Spriter will combine the two persistent objects and they will tween with eachother as you'd expect. If both objects exist on the same frame somewhere and you try to combine them, Spriter will alert you that they can't be combined and give you a list of frame numbers they both appear on. This ability to combine them in the persistent object editor is mainly for easily importing these old format animations, and adding tweening info.

The way you normally use this feature is that as you animate and create new keyframes, if you want to keep same tweened object and just change to a new image, select that sprite, and right click on the image you want to replace it with in the file palette. This also updates your persistent object palette. In addition to this, if you hold the right mouse button in the canvas (main center view) on sprite that has at least 2 images, you can switch between the images in realtime using an image strip that will appear directly below your pointer

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.

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.

  • Recently Browsing   0 members

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