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 :)
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.
uid: 106779 topic_id: 36022 reply_id: 143156