mariocaprino Posted May 8, 2012 Report Share Posted May 8, 2012 spriter-love2d Basic playback support for the 2D animation tool Spriter within the game framework love2d. https://github.com/capmar/spriter-love2d Quick start Drag the project folder spriter.love onto the love executable to launch the spriter demo. Use the arrow keys to move the demo character about. You may download the latest love executable for your platform from the love2d website: http://love2d.org/ Importing data In order to avoid parsing XML files during runtime, you need to convert Spriter SCML files to lua data files ahead of time. You should use the included python script scml2lua.py to convert files from Spriter to be read with spriter-love2d. You may download the latest free beta version of Spriter from Brashmonkey's website: http://brashmonkey.com/spriter.htm The following terminal command will convert the BetaFormatHero included with the Spriter beta to a lua data file: python scml2lua.py BetaFormatHero.SCML >> BetaFormatHero.SCML.lua Basic usage Include the file spriter.lua, your Spriter image folders and the converted SCML file in your own love2d project. Here is an outline of how to load and draw a frame of Spriter animation. local data= Spriter.new ('BetaFormatHero.lua')local anim= data.getAnim ('idle_healthy')local i= anim.getFrameIndex (tsec * 100)local frame= data.getFrame(anim.getFrameName (i))frame.draw(x, y, r, sx, sy) See the project file main.lua for an example of basic playback with Spriter. Feedback Contact me at @mariocaprino for comments and feedback! Quote Link to comment Share on other sites More sharing options...
Mike at BrashMonkey Posted May 8, 2012 Report Share Posted May 8, 2012 Awesome job mariocaprino! Quote Link to comment Share on other sites More sharing options...
onedaysnotice Posted May 13, 2012 Report Share Posted May 13, 2012 Does the hitbox functionality work with this as well? :S Quote Link to comment Share on other sites More sharing options...
mariocaprino Posted May 13, 2012 Author Report Share Posted May 13, 2012 Does the hitbox functionality work with this as well? :S There is currently no support for hitboxes. If you tell me what you are trying to do - how you plan to use hitboxes with Spriter - I could possibly add something that suits your need. The beta file format example BetaFormatHero.SCML contains only one bbox per character. I believe there are plans to expand on bbox information exported from Spriter in later versions, but in it's current state I don't see how it is useful. 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.