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?
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.
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
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.
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.
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!
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
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.
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.
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!