Jump to content

Spriter Scheme


netguy204

Recommended Posts

I wrote a SCML parser / playback tool as part of a Scheme game-engine I'm working on. The SCML code is nicely abstracted from the rest of the engine so it should be very easy to port.

You can see a video of it here: http://youtu.be/QH6uS8z6zrg

Here's the code:

https://github.com/netguy204/gambit-game-lib/blob/master/spriter.scm

It implements the final SCML spec (post beta) as described here: http://www.brashmonkeygames.com/spriter/8-17-2012/GettingStartedWithSCMLGuide(a2).pdf

To load an animation:


(define +scml+ (scml-load "monster/Example.SCML"))
(define +idle+ (animation (entity +scml+ "0") "Idle"))

The length of the animation (in seconds) is:


(animation-length +idle+)

To interpolate the animation to any time between 0 and its animation-length:


(interp-anim anim time)

This returns a list of tkey objects which contain the interpolated rotations, positions, and centers for all of the sprite fragments presented in the order they should be drawn.

Here's an example of it being used: https://github.com/netguy204/gambit-game-lib/blob/46c8723ebf7663fe0ba04fc0853d1337515787e7/scmlib.scm#L76

Hopefully this saves someone some time!

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.

  • Recently Browsing   0 members

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