Hello,
I’m looking for a way to mix spine skins.
An ideal way for me is to use Skin API documented here: http://ja.esotericsoftware.com/spine-api-reference#Skin
a sample code is like this. (this sample code is used in a lua project)
local skinNames = ["headA", "bodyB", "legC"]
local mixedSkin = Spine.Skin.new("mixed")
for _, skinName in pairs(skinNames) do
local skin = self.skeleton.data:findSkin(skinName)
local attachmentsA = skin.attachments
for slotIndex, attachments in pairs(attachmentsA) do
for name, attachment in pairs(attachments) do
mixedSkin:addAttachment(slotIndex, name, attachment)
end
end
end
self.skeleton:setSkinByReference(mixedSkin)
but it seems that cocos creator’s API does not provides Skin
class nor Skeleton.setSkin(skin)
according to this page: https://docs.cocos2d-x.org/creator/api/en/classes/Skeleton.html
Is there a way to mix skins?
Thanks.