Can't get Spine examples to work with current build (2014.2189)

Hi guys,

I was looking at the Spine tool and it seems quite impressive, but I’m wondering if it’s compatible with recent Corona builds - does anyone know for sure? Has anyone tried running the examples from Spine with 2014.2189?

Here’s what I did

  • Downloaded examples from

https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-corona

The example is supposed to show some draw order shuffling, jump, and then walk indefinitely. However, the walking animation does not work. In the Goblin example, no animation works at all, the goblin just stands there blinking its eyes.

I also tried without the Graphics 2.0 pull request and enabling Graphics 1.0 compatibility mode. No luck.

Anyone? :slight_smile:

Can’t check right now (@work), but animation works for me 2014.2189 when applied pull request you mentioned.

No worries about the spine examples they’re not that much working, they work but with bugs !

The General Idea of the runtime work, so check everywhere in topics on spine website and here and make your own runtime.

I think Spine developer are going to edit that later

Thanks for the help, everyone!

I ended up buying Spine, and it does indeed work with 2014.2189 and Graphics 2.0. Just got my first animations into the game. :slight_smile:

I’ve reached the conclusion that in the current Spine runtime, Animations work fine, but AnimationStates do not. This is why none of the Spine examples are working.

I tried to debug the AnimationState a bit to see what’s going wrong, but couldn’t figure it out. Plan B is to just use Animations and roll my own AnimationState, I guess :slight_smile:

Has anyone got AnimationStates working with the current Corona build?

The current corona build should not matter for the AnimationState since most of the actual runtime that corona uses is the plain lua runtime. What is the issue with AnimationState?

I currently have AnimationState working, but it is not the most recent spine-runtime or corona build.

Thanks for the feedback! My issue is basically that the bones do not get moved. Other parts of the animation happen (draw order changes and image slot replacements / “eye blinking”), but otherwise the skeletons stand still.

Excerpt of my code:

local skeletonJson = spine.SkeletonJson.new() skeletonJson.scale = 0.35 self.skeletonData = skeletonJson:readSkeletonDataFile("img/player/player.json") self.skeleton = spine.Skeleton.new(self.skeletonData) function self.skeleton:createImage (attachment) return display.newImage("img/player/" .. attachment.name .. ".png") end self.skeleton:setToSetupPose() local animationStateData = spine.AnimationStateData.new(self.skeletonData) self.animationState = spine.AnimationState.new(animationStateData) self.animationState:setAnimationByName(0, "stand1", true) Runtime:addEventListener("enterFrame", function(event) self:animate(event) end) (...) function player:animate(event)   local delta = 0.01   self.animationState:update(delta)   self.animationState:apply(self.skeleton)   self.skeleton:updateWorldTransform() end

Am I doing something incorrectly? If I use the animation directly, e.g. skeletonData.findAnimation(“stand1”):apply(skeleton), the animation works.

Thanks again for helping me out with this. :slight_smile:

PS: I know the delta isn’t supposed to be a fixed value but use the system time, this is just me playing with the speed of the animations.

Unfortunately I can’t see anything there that looks like a problem. I’m at work right now so I can’t really look into it :confused:

Actually, merely your statement that you got AnimationStates working with an older version of the Spine runtime pointed me in the right direction. I went to the Git repo and checked out an old version of AnimationState.lua (from January), and AnimationState now seems to be working correctly!

Thanks again for the help.

Cool. Glad it worked out :slight_smile:

Good luck going forward.

Thanks guys ! I was looking for an issue with the same problem, I did not even think about it

It helps me a lot, I thought it was my mistake.

Now almost everything work fine :wink:

Can’t check right now (@work), but animation works for me 2014.2189 when applied pull request you mentioned.

No worries about the spine examples they’re not that much working, they work but with bugs !

The General Idea of the runtime work, so check everywhere in topics on spine website and here and make your own runtime.

I think Spine developer are going to edit that later

Thanks for the help, everyone!

I ended up buying Spine, and it does indeed work with 2014.2189 and Graphics 2.0. Just got my first animations into the game. :slight_smile:

I’ve reached the conclusion that in the current Spine runtime, Animations work fine, but AnimationStates do not. This is why none of the Spine examples are working.

I tried to debug the AnimationState a bit to see what’s going wrong, but couldn’t figure it out. Plan B is to just use Animations and roll my own AnimationState, I guess :slight_smile:

Has anyone got AnimationStates working with the current Corona build?

The current corona build should not matter for the AnimationState since most of the actual runtime that corona uses is the plain lua runtime. What is the issue with AnimationState?

I currently have AnimationState working, but it is not the most recent spine-runtime or corona build.

Thanks for the feedback! My issue is basically that the bones do not get moved. Other parts of the animation happen (draw order changes and image slot replacements / “eye blinking”), but otherwise the skeletons stand still.

Excerpt of my code:

local skeletonJson = spine.SkeletonJson.new() skeletonJson.scale = 0.35 self.skeletonData = skeletonJson:readSkeletonDataFile("img/player/player.json") self.skeleton = spine.Skeleton.new(self.skeletonData) function self.skeleton:createImage (attachment) return display.newImage("img/player/" .. attachment.name .. ".png") end self.skeleton:setToSetupPose() local animationStateData = spine.AnimationStateData.new(self.skeletonData) self.animationState = spine.AnimationState.new(animationStateData) self.animationState:setAnimationByName(0, "stand1", true) Runtime:addEventListener("enterFrame", function(event) self:animate(event) end) (...) function player:animate(event)   local delta = 0.01   self.animationState:update(delta)   self.animationState:apply(self.skeleton)   self.skeleton:updateWorldTransform() end

Am I doing something incorrectly? If I use the animation directly, e.g. skeletonData.findAnimation(“stand1”):apply(skeleton), the animation works.

Thanks again for helping me out with this. :slight_smile:

PS: I know the delta isn’t supposed to be a fixed value but use the system time, this is just me playing with the speed of the animations.

Unfortunately I can’t see anything there that looks like a problem. I’m at work right now so I can’t really look into it :confused:

Actually, merely your statement that you got AnimationStates working with an older version of the Spine runtime pointed me in the right direction. I went to the Git repo and checked out an old version of AnimationState.lua (from January), and AnimationState now seems to be working correctly!

Thanks again for the help.

Cool. Glad it worked out :slight_smile:

Good luck going forward.