Hi everyone,
I’m facing an issue with Spine in CC 3.8.0. I tried to create a skeleton node at runtime and load SkeletonData
from a resource. The node and sp.Skeleton
component were successfully created, but it only shows a static image; the animation is not running.
Here is the code:
resources.load('animations/rambu', sp.SkeletonData, (err, skeletonData) => {
if (err) {
error(err);
return;
}
const anims = Object.keys(skeletonData.getAnimsEnum()).filter(key => key !== '<None>');
const skeletonNode = new Node();
skeletonNode.parent = this.node;
const skeleton = skeletonNode.addComponent(sp.Skeleton);
skeleton.skeletonData = skeletonData;
skeleton.animation = anims[0];
skeleton.premultipliedAlpha = false;
skeleton.loop = true;
});
and here is the result: