Figured it out.
blendIn=blendIn+.03
if(blendIn>1)then
idleAnimation:apply(skeleton, animationTime, true)
else
walkAnimation:apply(skeleton, animationTime, true)
idleAnimation:mix(skeleton, animationTime, true,blendIn)
end
Full code
local spine = require "spine-corona.spine"
local json = spine.SkeletonJson.new()
json.scale = 1
local skeletonData = json:readSkeletonDataFile("data/spineboy.json")
local idleAnimation = skeletonData:findAnimation("idle")
local walkAnimation = skeletonData:findAnimation("walk")
local skeleton = spine.Skeleton.new(skeletonData)
function skeleton:createImage (attachment)
---
Customize where images are loaded.
return display.newImage("data/" .. attachment.name .. ".png")
end
skeleton.x = 150
skeleton.y = 325
skeleton.flipX = false
skeleton.flipY = false
skeleton.debug = false
---
Omit or set to false to not draw debug lines on top of the images.
skeleton:setToBindPose()
local lastTime = 0
local animationTime = 0
local count=0
local blendIn=0
Runtime:addEventListener("enterFrame", function (event)
---
Compute time in seconds since last frame.
local currentTime = event.time / 1000
local delta = currentTime - lastTime
lastTime = currentTime
count=count+1
---
Accumulate time and pose skeleton using animation.
animationTime = animationTime + delta
if(count<120)then
walkAnimation:apply(skeleton, animationTime, true)
else
blendIn=blendIn+.03
if(blendIn>1)then
idleAnimation:apply(skeleton, animationTime, true)
else
walkAnimation:apply(skeleton, animationTime, true)
idleAnimation:mix(skeleton, animationTime, true,blendIn)
end
end
skeleton:updateWorldTransform()
end)