I took the unmodified example files from the export folder (raptor.json, raptor.atlas, raptor.png).
This is my setup.
local raptor = spine.Actor(lfs.DROPBOX.."/spine-data", "raptor.json", "raptor.atlas")
raptor:setPosition(-200, 0)
---
sets skeleton.x and skeleton.y
raptor:setScale(.25)
---
scales the root bone as shown in post above
raptor:setAnimation("walk")
---
play a sequence of chained animations
raptor:queueAnimation("walk")
---
build animation queue
raptor:queueAnimation("walk")
raptor:queueAnimation("Jump")
raptor:queueAnimation("walk", true)
This is what the *:setAnimation() and *:queueAnimation() methods do.
Basically I wrapped some spine methods for convenience. All animations play only on one track entry.
function spine.Actor:setAnimation(new_animation_name, loop, crossfade_time)
local track_entry = self.animation:setAnimationByName(0, new_animation_name, loop)
track_entry.mixDuration = crossfade_time or .25
end
function spine.Actor:queueAnimation(animation_name, loop, delay)
self.animation:addAnimationByName(0, animation_name, loop, delay or 0)
end
self.animation is an AnimationState.new() instance.