Page 2 of 3

Re: SPINE - Animation Software (LÖVE compatible)

Posted: Tue Mar 26, 2013 3:16 pm
by Chèvre
I'm interested in Spine and I'd like to try it out with LÖVE. I'd be willing to tweak the Corona runtime to make it work with LÖVE. But before I do that, I'm wondering if anybody is working on it already, or if there's already a working implementation out there?

Re: SPINE - Animation Software (LÖVE compatible)

Posted: Tue Mar 26, 2013 5:04 pm
by NateS
Not that I know of, no. I want to make the Lua runtime so the majority of it is reusable, then people only have to implement rendering for whatever game toolkit. I'm neck deep in C/C++/ObjC crap though. :(

Re: SPINE - Animation Software (LÖVE compatible)

Posted: Mon Apr 01, 2013 5:49 pm
by Chèvre
I've ported Spine to LÖVE! :)

Changes are documented in readme.txt, but basically, I've isolated the API-agnostic code in a separate package, so that the platform-specific parts boil down to very little code. As a proof of concept, the included .love file is runnable with LÖVE of course, but if you extract it and rename "corona-main.lua" to "main.lua", it still works with Corona.

Since I don't have a full copy of Spine (yet!), I couldn't really test this extensively, but it seems to work alright with spineboy and goblins... Except for the fact that after mixing two animations, the angle seems to be off by a few degrees (I'm probably not using the API exactly as intended?).
3V8553l.png
3V8553l.png (66.63 KiB) Viewed 1070 times

Re: SPINE - Animation Software (LÖVE compatible)

Posted: Mon Apr 01, 2013 11:06 pm
by NateS
Cool! Thanks for that! :) I haven't looked at the code yet, but do you mind if I made use of it for Spine? You would need to release it under the same license as the Spine runtimes (simplified BSD).

Not sure on the angle issue, would have to see it. For Java and C/C++ I've implemented two classes called AnimationStateData and AnimationState which handle mixing animations for you. It's way more convenient. I haven't ported it to Lua yet, but it shouldn't be hard.

Re: SPINE - Animation Software (LÖVE compatible)

Posted: Wed Apr 03, 2013 5:35 pm
by Chèvre
Sure! I've added a license blurb in all the Lua files that were missing one, and I've left your original license in the files that I haven't written from scratch. The updated file is in my original message.

Re: SPINE - Animation Software (LÖVE compatible)

Posted: Thu Apr 18, 2013 10:26 am
by monsieur_h
Thank you chevre !

I'm trying to use your runtime in my project but I have some issue when loading the data. I'm not at ease with Spine's architecture yet, and I have a single file as a result of my export. It contains evrything (bones, slots, animation... ). I don't see how I can load and apply my animations from it. I struggle finding a good bootstrap in the official documentation, so, at this point, any hint is welcome ! :awesome:

Thank you !

Re: SPINE - Animation Software (LÖVE compatible)

Posted: Thu Apr 18, 2013 10:37 am
by NateS
Spine's export format has changed, sorry about that. The data is the same, it is just in a single file. You can probably grab the Lua from spine-corona on Spine's runtime github repo and fix up the Love runtime pretty easily.

Re: SPINE - Animation Software (LÖVE compatible)

Posted: Fri Apr 19, 2013 9:32 am
by NateS
I've created a generic Lua runtime and refactored spine-corona to use it. I've also added an official LÖVE runtime. :) Thanks Chèvre! Using your code as a reference made it very easy. :)

Re: SPINE - Animation Software (LÖVE compatible)

Posted: Fri Apr 19, 2013 5:23 pm
by monsieur_h
Great ! You did it really fast and it's really easy to use now! I made a little try over there and I'm really happy with it (even I'm a fairly poor animator). :nyu:

Re: SPINE - Animation Software (LÖVE compatible)

Posted: Fri Apr 26, 2013 12:53 pm
by SiENcE
NateS wrote:I've created a generic Lua runtime and refactored spine-corona to use it. I've also added an official LÖVE runtime. :) Thanks Chèvre! Using your code as a reference made it very easy. :)
Great thats now official supported!

Thanks.