netguy204 Posted August 30, 2012 Report Share Posted August 30, 2012 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! Quote Link to comment Share on other sites More sharing options...
Mike at BrashMonkey Posted August 30, 2012 Report Share Posted August 30, 2012 Awesome job netguy204! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.