So, really struggling here and could use some guidance. I just need to know the most basic method to get an animation on screen using Spine.
-- Require in the spine manager local spine = require ("spine-corona.spine") -- Extract animation data from Json -- Assume it's in a folder called "anim" and is named "skeleton.json" local json = spine.SkeletonJson.new() local data = json:readSkeletonDataFile("anim/skeleton.json") -- Make the skeleton using this data local char = spine.Skeleton.new( data ) -- Fetch the idle animation local idle = data:findAnimation( "idle" ) -- Overwrite how spine creates bone animations. -- Assume seperate images; no imageSheets. function char:createImage(attachment) return display.newImage("anim/"..attachment.name..".png") end -- Set the animation state -- If I remove this line, Corona loads with no error messages, -- but there is no character on-screen. idle.apply( char, nil, true)
Unfortunately, idle.apply complains that char (the skeleton) is nil. (It's not - a print statement confirms it.) However, looking at the animationState code, it's looking for "skeleton.skeletonData", which doesn't seem to exist.
Where am I going wrong? The esoteric sample code is nice but I don't have animations to blend together. Just a single skeleton with a single animation to play.