How Spine works with corona?

Hello guys.

I am still curious how to go from designing an animation with Spine to actually using it with Corona. My understanding that Spine output a Json file but what’s next? How do I use that file with corona? Is there any list of command that control the animations?

I hope it is not an obvious question!

Mo
@LairdGames

EDIT: I agree with people here. Spine is one of the best thing that happened recently for indies developers! [import]uid: 100814 topic_id: 36022 reply_id: 336022[/import]

Hey Mo,

I think they are working on documentation, there’s not much now. If you go to their site and browse the forum, there are some insights to glean.

Not sure if you saw my post, you didn’t leave a comment so no idea. Take a look at the video I made of my Super iBot integration. I think you’ll like what you see. You’ll also want to read the thread.

Super iBot created with Spine thread

Since my app was built and working, even though it looks like a simple platformer, there is a lot going on with the iBot. So what I basically did was set the static iBot .png to a .01 alpha after I got it working. If I stumble, I go back and set the iBot .png alpha to 1 so I can see where the animation should be. Anyways, basically the animations coordinates track the iBot .png’s x & y coordinates.

It actually works quite well to have an easily visible “marker” showing where the animation should be playing and I’ll use this technique on new projects, it really helps a newb like me.

You want to study the main.lua that comes with the spineboy example. You’ll see what’s going on there. I used it as a template to integrate.

Ok, that should cover the integration concept, so here’s basically how it works.

First I created a new module to hold everything… mySpine.lua :slight_smile:

Then you load the skeleton data for the animation. I only have 1 character, my iBot, so I only have 1 Setup pose that contains all the “bones” and data relating to the basic pose.

local skeletonData = json:readSkeletonDataFile("data/YourSkeleton.json")

Then you create the “AnimationObject” I guess it would be called.

YourAnimationObject = json:readAnimationFile(skeletonData, "data/skeleton-YourSpineCreatedAnimation.json")

I have only created 1 “AnimationObject” and keep changing out my different animations it plays. Since there are very few Spine examples, I had to create my own methods to handle changing animations and well, pretty much everything else. Nate @ Spine had to hand hold me through a few parts I didn’t understand. The thread is on their board, a couple of good insights there.

I built a table that holds all the animations and just grab them as I need them.

The animations update every frame with the Runtime listener you’ll see in the example main.lua.

Realize the example doesn’t even come close to displaying what can be done programmically
with the Spine runtimes which are modules.

So bascially, I only “load” the json animations built in the Spine editor into the “AnimationObject” which are played through the Runtime listener. Building the animations is the easy part from my experience due to the lack of lua examples.

The next thing I knew, I had a fully animated iBot jumping all over my display screen replacing the boring static .png. Oh…he has a cannon now that aims with the user’s drag to fire the electro orbs.

Yeah, you can dynamically alter the animations or poses you make in Spine with “touch” events…it’s really cool.

Spine ROCKS!

Nail

[import]uid: 106779 topic_id: 36022 reply_id: 143156[/import]

I guess what you basicly need to know is that the runtime module you should require in order to import the json files spine exports comes with spine when you purchase it. So you can’t import the animations from spine with the trial version.
I agree spine is very cool. [import]uid: 13632 topic_id: 36022 reply_id: 143158[/import]

ojnab, you are correct. I didn’t even realize that. That’s a very important part of the equation, the Runtime modules and obviously the example main.lua. eeek!

I only tried the trial editor for a couple of minutes and instantly saw it would work for me and went ahead and purchased the tool right away, I’ve been buried in it since and didn’t even realize the runtimes aren’t included with the trial. Sorry about that gang.

There’s really not a lot more to the main.lua than what I posted above, just add the listener and a few parameters.

Nail [import]uid: 106779 topic_id: 36022 reply_id: 143161[/import]

@nail
He he. I also bought it after trying it for something like 2 seconds.
I don’t understand why there isn’t anymore fuzz about spine in this forum.
This is the coolest thing that happend for corona based games since corona! [import]uid: 13632 topic_id: 36022 reply_id: 143166[/import]

@ojnab, agreed.

Spine is like a “mini Corona” inside Corona that specializes in graphics. Talk about really “bringing apps to life”! Jaw on floor thinking about the relatively easy possibilities…

Nail [import]uid: 106779 topic_id: 36022 reply_id: 143210[/import]

Thank you guys. Sorry I am sorry for the delay, i am in vacation with limited Internet. I cannot wait to get home and play with Spine (don’t tell my wife:). Thanks Nail, you ibot looks phenomenal!

I will have a million more questions when I get back online!

Mo [import]uid: 100814 topic_id: 36022 reply_id: 143275[/import]

Thanks xnailbender you answered my questions I had about Spine too. I tried it for a few mins and backed them on kickstarter so no Runtimes for me until they release it on GitHub or Saturday when the kickstarter ends. Spine is an amazing tool! [import]uid: 58885 topic_id: 36022 reply_id: 143279[/import]

Hey Mo,

I think they are working on documentation, there’s not much now. If you go to their site and browse the forum, there are some insights to glean.

Not sure if you saw my post, you didn’t leave a comment so no idea. Take a look at the video I made of my Super iBot integration. I think you’ll like what you see. You’ll also want to read the thread.

Super iBot created with Spine thread

Since my app was built and working, even though it looks like a simple platformer, there is a lot going on with the iBot. So what I basically did was set the static iBot .png to a .01 alpha after I got it working. If I stumble, I go back and set the iBot .png alpha to 1 so I can see where the animation should be. Anyways, basically the animations coordinates track the iBot .png’s x & y coordinates.

It actually works quite well to have an easily visible “marker” showing where the animation should be playing and I’ll use this technique on new projects, it really helps a newb like me.

You want to study the main.lua that comes with the spineboy example. You’ll see what’s going on there. I used it as a template to integrate.

Ok, that should cover the integration concept, so here’s basically how it works.

First I created a new module to hold everything… mySpine.lua :slight_smile:

Then you load the skeleton data for the animation. I only have 1 character, my iBot, so I only have 1 Setup pose that contains all the “bones” and data relating to the basic pose.

local skeletonData = json:readSkeletonDataFile("data/YourSkeleton.json")

Then you create the “AnimationObject” I guess it would be called.

YourAnimationObject = json:readAnimationFile(skeletonData, "data/skeleton-YourSpineCreatedAnimation.json")

I have only created 1 “AnimationObject” and keep changing out my different animations it plays. Since there are very few Spine examples, I had to create my own methods to handle changing animations and well, pretty much everything else. Nate @ Spine had to hand hold me through a few parts I didn’t understand. The thread is on their board, a couple of good insights there.

I built a table that holds all the animations and just grab them as I need them.

The animations update every frame with the Runtime listener you’ll see in the example main.lua.

Realize the example doesn’t even come close to displaying what can be done programmically
with the Spine runtimes which are modules.

So bascially, I only “load” the json animations built in the Spine editor into the “AnimationObject” which are played through the Runtime listener. Building the animations is the easy part from my experience due to the lack of lua examples.

The next thing I knew, I had a fully animated iBot jumping all over my display screen replacing the boring static .png. Oh…he has a cannon now that aims with the user’s drag to fire the electro orbs.

Yeah, you can dynamically alter the animations or poses you make in Spine with “touch” events…it’s really cool.

Spine ROCKS!

Nail

[import]uid: 106779 topic_id: 36022 reply_id: 143156[/import]

I guess what you basicly need to know is that the runtime module you should require in order to import the json files spine exports comes with spine when you purchase it. So you can’t import the animations from spine with the trial version.
I agree spine is very cool. [import]uid: 13632 topic_id: 36022 reply_id: 143158[/import]

ojnab, you are correct. I didn’t even realize that. That’s a very important part of the equation, the Runtime modules and obviously the example main.lua. eeek!

I only tried the trial editor for a couple of minutes and instantly saw it would work for me and went ahead and purchased the tool right away, I’ve been buried in it since and didn’t even realize the runtimes aren’t included with the trial. Sorry about that gang.

There’s really not a lot more to the main.lua than what I posted above, just add the listener and a few parameters.

Nail [import]uid: 106779 topic_id: 36022 reply_id: 143161[/import]

@nail
He he. I also bought it after trying it for something like 2 seconds.
I don’t understand why there isn’t anymore fuzz about spine in this forum.
This is the coolest thing that happend for corona based games since corona! [import]uid: 13632 topic_id: 36022 reply_id: 143166[/import]

@ojnab, agreed.

Spine is like a “mini Corona” inside Corona that specializes in graphics. Talk about really “bringing apps to life”! Jaw on floor thinking about the relatively easy possibilities…

Nail [import]uid: 106779 topic_id: 36022 reply_id: 143210[/import]

Thank you guys. Sorry I am sorry for the delay, i am in vacation with limited Internet. I cannot wait to get home and play with Spine (don’t tell my wife:). Thanks Nail, you ibot looks phenomenal!

I will have a million more questions when I get back online!

Mo [import]uid: 100814 topic_id: 36022 reply_id: 143275[/import]

Thanks xnailbender you answered my questions I had about Spine too. I tried it for a few mins and backed them on kickstarter so no Runtimes for me until they release it on GitHub or Saturday when the kickstarter ends. Spine is an amazing tool! [import]uid: 58885 topic_id: 36022 reply_id: 143279[/import]

Hey Mo,

I think they are working on documentation, there’s not much now. If you go to their site and browse the forum, there are some insights to glean.

Not sure if you saw my post, you didn’t leave a comment so no idea. Take a look at the video I made of my Super iBot integration. I think you’ll like what you see. You’ll also want to read the thread.

Super iBot created with Spine thread

Since my app was built and working, even though it looks like a simple platformer, there is a lot going on with the iBot. So what I basically did was set the static iBot .png to a .01 alpha after I got it working. If I stumble, I go back and set the iBot .png alpha to 1 so I can see where the animation should be. Anyways, basically the animations coordinates track the iBot .png’s x & y coordinates.

It actually works quite well to have an easily visible “marker” showing where the animation should be playing and I’ll use this technique on new projects, it really helps a newb like me.

You want to study the main.lua that comes with the spineboy example. You’ll see what’s going on there. I used it as a template to integrate.

Ok, that should cover the integration concept, so here’s basically how it works.

First I created a new module to hold everything… mySpine.lua :slight_smile:

Then you load the skeleton data for the animation. I only have 1 character, my iBot, so I only have 1 Setup pose that contains all the “bones” and data relating to the basic pose.

local skeletonData = json:readSkeletonDataFile("data/YourSkeleton.json")

Then you create the “AnimationObject” I guess it would be called.

YourAnimationObject = json:readAnimationFile(skeletonData, "data/skeleton-YourSpineCreatedAnimation.json")

I have only created 1 “AnimationObject” and keep changing out my different animations it plays. Since there are very few Spine examples, I had to create my own methods to handle changing animations and well, pretty much everything else. Nate @ Spine had to hand hold me through a few parts I didn’t understand. The thread is on their board, a couple of good insights there.

I built a table that holds all the animations and just grab them as I need them.

The animations update every frame with the Runtime listener you’ll see in the example main.lua.

Realize the example doesn’t even come close to displaying what can be done programmically
with the Spine runtimes which are modules.

So bascially, I only “load” the json animations built in the Spine editor into the “AnimationObject” which are played through the Runtime listener. Building the animations is the easy part from my experience due to the lack of lua examples.

The next thing I knew, I had a fully animated iBot jumping all over my display screen replacing the boring static .png. Oh…he has a cannon now that aims with the user’s drag to fire the electro orbs.

Yeah, you can dynamically alter the animations or poses you make in Spine with “touch” events…it’s really cool.

Spine ROCKS!

Nail

[import]uid: 106779 topic_id: 36022 reply_id: 143156[/import]

I guess what you basicly need to know is that the runtime module you should require in order to import the json files spine exports comes with spine when you purchase it. So you can’t import the animations from spine with the trial version.
I agree spine is very cool. [import]uid: 13632 topic_id: 36022 reply_id: 143158[/import]

ojnab, you are correct. I didn’t even realize that. That’s a very important part of the equation, the Runtime modules and obviously the example main.lua. eeek!

I only tried the trial editor for a couple of minutes and instantly saw it would work for me and went ahead and purchased the tool right away, I’ve been buried in it since and didn’t even realize the runtimes aren’t included with the trial. Sorry about that gang.

There’s really not a lot more to the main.lua than what I posted above, just add the listener and a few parameters.

Nail [import]uid: 106779 topic_id: 36022 reply_id: 143161[/import]

@nail
He he. I also bought it after trying it for something like 2 seconds.
I don’t understand why there isn’t anymore fuzz about spine in this forum.
This is the coolest thing that happend for corona based games since corona! [import]uid: 13632 topic_id: 36022 reply_id: 143166[/import]

@ojnab, agreed.

Spine is like a “mini Corona” inside Corona that specializes in graphics. Talk about really “bringing apps to life”! Jaw on floor thinking about the relatively easy possibilities…

Nail [import]uid: 106779 topic_id: 36022 reply_id: 143210[/import]