Use setAnimationByName instead of setAnimation

* goblin and dragon examples wouldn't start without this fix
This commit is contained in:
Felix Holmgren 2013-10-24 00:36:38 +02:00
parent 2e46d250e5
commit ee5dd750a5
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ skeleton:setToSetupPose()
local stateData = spine.AnimationStateData.new(skeletonData)
-- AnimationState has a queue of animations and can apply them with crossfading.
local state = spine.AnimationState.new(stateData)
state:setAnimation("flying", true)
state:setAnimationByName(0, "flying", true, 0)
local lastTime = 0
local animationTime = 0

View File

@ -22,7 +22,7 @@ skeleton:setToSetupPose() -- Required after changing skin to attach attachments
-- AnimationState has a queue of animations and can apply them with crossfading.
local stateData = spine.AnimationStateData.new(skeletonData)
local state = spine.AnimationState.new(stateData)
state:setAnimation("walk", true)
state:setAnimationByName(0, "walk", true, 0)
local lastTime = 0
local animationTime = 0