SPINE - Animation Software (LÖVE compatible)

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Chèvre
Prole
Posts: 16
Joined: Sun Sep 16, 2012 4:53 pm
Location: France

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

Post 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?
NateS
Prole
Posts: 8
Joined: Thu Feb 14, 2013 1:47 pm

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

Post 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. :(
User avatar
Chèvre
Prole
Posts: 16
Joined: Sun Sep 16, 2012 4:53 pm
Location: France

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

Post 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 1072 times
Attachments
spinedemo.love
(287.57 KiB) Downloaded 421 times
Last edited by Chèvre on Wed Apr 03, 2013 5:33 pm, edited 1 time in total.
NateS
Prole
Posts: 8
Joined: Thu Feb 14, 2013 1:47 pm

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

Post 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.
User avatar
Chèvre
Prole
Posts: 16
Joined: Sun Sep 16, 2012 4:53 pm
Location: France

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

Post 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.
User avatar
monsieur_h
Citizen
Posts: 69
Joined: Tue Oct 30, 2012 4:43 pm

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

Post 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 !
NateS
Prole
Posts: 8
Joined: Thu Feb 14, 2013 1:47 pm

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

Post 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.
NateS
Prole
Posts: 8
Joined: Thu Feb 14, 2013 1:47 pm

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

Post 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. :)
User avatar
monsieur_h
Citizen
Posts: 69
Joined: Tue Oct 30, 2012 4:43 pm

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

Post 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:
User avatar
SiENcE
Party member
Posts: 805
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

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

Post 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.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 4 guests