To use multiple skins at runtime in Spine, you can create a new skin by combining multiple existing skins. This is done by creating an empty skin and adding other skins to it using the addSkin()
method. This approach allows you to mix and match different parts of skins to achieve the desired look. Although the Defold (extension-spine) API may only accept one skin hash, you can work around this by programmatically creating a combined skin that includes all the desired elements from multiple skins. Once the combined skin is created, you can set it on the skeleton.
For example, in the Spine runtime, you can create a custom skin and add other skins to it like this:
const skeletonData = spineObject.skeleton.data;
const customSkin = new spine.Skin("custom");
customSkin.addSkin(skeletonData.findSkin("skin1"));
customSkin.addSkin(skeletonData.findSkin("skin2"));
// Add more skins as needed
spineObject.skeleton.setSkin(customSkin);
spineObject.skeleton.setToSetupPose();
This method allows you to effectively use multiple skins by combining them into one.