Hello, having some issues with spine/cocos2dx (very beginner level here, so if i'm missing some info from the issue description please let me know)
I'm working with a spine skeleton model using cocos2dx; the skeleton initializes with an atlas that's mapped with a image with a lot of textures for each of its slots/attachments. I also have other image files to use as textures, but these are separate (and the initial atlas/image is an all-in-one for all the textures)
I'm trying to change the textures on different attachments, but I'm having some issues with slots that have multiple attachments which need to load from a single image file with just a subset of the textures from the original atlas
an example (maybe too detailed):
- the original atlas/sprite image has among others, an image structure of a "shirt", consisting of 3 parts that go on 3 attachments (ie 2 sleeves and 1 main body)
- i have new sprite images consist only of that shirt part with 3 pieces (like it was extracted from the original atlas image), following the same structure/proportion, but also larger in pixels, so if you scale the whole image down it will eventually map over the original image/atlas
I'm using this code to load simple assets (one texture in the png file) (example: hats or masks, which consist of a single piece) and it seems to be working, but I can't figure out how to do the same on multiple-asset images (one png with 2 sleeves and 1 body which would go on 3 slots for each of the three pieces)
Texture2D *texture = new (std::nothrow) Texture2D();
cocos2d::Size sz = cocos2d::Size(image->getWidth(), image->getHeight());
bool textureCreatedSuccessfuly = texture->initWithData(image->getData(), image->getDataLen(), Texture2D:😛ixelFormat::RGBA8888, image->getWidth(), image->getHeight(), sz);
spMeshAttachment* mesh ;
mesh = SUB_CAST(spMeshAttachment, slot->attachment);
AttachmentVertices *attachmentVertices = SUB_CAST(AttachmentVertices, mesh->rendererObject);
attachmentVertices->_texture = texture;