We need to load two skeletons into our Corona scene so that each can be inserted into their own group. We are able to load two separate Spine json files and apply them to skeletons but how do you then target a particular skeleton/state with animation.
We set skeletonData in a module called "Spine Trigger". It is run every time a new skeleton is required:
local skeletonData = json:readSkeletonDataFile("spineData/"..file..".json")
local skeleton = spine.Skeleton.new(skeletonData)
and setting animation with..
state:setAnimationByName(trackIndex, name, loop, 0)
But of course state only reflects the last execution of "Spine Trigger" so only the last skeleton will receive animation calls.
Do we need unique names for skeleton, skeletonData and state each time a new file is loaded? e.g. skeleton[1], skeleton[2]?
Any insights into working with multiple skeletons most appreciated.