Hello to all 😃
I want to use the ETC1 compression format for spine animations and improve performance on Android platform, but I can’t add an alpha channel to the texture.
A little search by code revealed the ability to attach a file with an alpha channel using the suffix “@alpha”.
I compress “sleleton.png” animations texture file using TexturePacker in 2 files - “skeleton.pkm” for RGB and “skeleton.pkm@alpha”.
Suffix great works with objects of the Sprite class(i use create() method), but does not work for “spine::SkeletonAnimation”. What can I do about it?
Code:
auto tmpSprite = Sprite::create(animDir + “skeleton.pkm”);
bg->addChild(tmpSprite);
tmpSprite->setPosition(center);
auto tmpSk = spine::SkeletonAnimation::createWithJsonFile(animDir + “skeleton.json”, animDir + “skeleton.atlas”);
tmpSk->setAnimation(0, “static”, true);
bg->addChild(tmpSk);
tmpSk->setPosition(center + Vec2(500, 0));
result:
Left is the Sprite (from the animation atlas)
Right is the spine::SkeletonAnimation, there is no alpha channel