Cocos2d-X 动画闪烁红色

Cocos2d-X animation blinking red

当我启动一个动画(使用下面的代码)时,除起始图片外,所有 sprites.png 的颜色都错误(红色),所以它看起来像是在闪烁红色。 我想知道是否有人知道这是什么原因造成的? 我使用 TexturePacker 制作精灵 sheet,设置:像素格式:RGBA8888,纹理格式:PVR+zlib。 这是我的动画代码,我在我的播放器 class 中,它是在创建时启动的:

FileUtils::getInstance()->addSearchResolutionsOrder("indian_spreedsheet/HD");
// load and cache the texture and sprite frames
auto cacher = SpriteFrameCache::getInstance();
cacher->addSpriteFramesWithFile("indian_walk.plist");

#include <sstream>
// load all the animation frames into an array
const int kNumberOfFrames = 4;
Vector<SpriteFrame*> frames;
for (int i = 1; i < kNumberOfFrames; i++)
{
    std::string s = std::to_string( i );

    SpriteFrame* aFrame =
    cacher->getSpriteFrameByName( "indian_walk" + s + ".png" );
    frames.pushBack(aFrame);
}

// play the animation
auto animation = Animation::createWithSpriteFrames(frames, 0.40f);
animation->setRestoreOriginalFrame(true);
moveAnimate = Animate::create(animation);
moveAnimate->retain();

我在 Visual Studio 工作,使用 Cocos2d-x 3.3 版。 如果有人觉得有必要,我可以附上活动的照片。 提前致谢!

检查你的“indian_walk.png”,上面有没有红色?

如官方文档所述:

Is there a trial version?

Yes, there is a 7-day trial mode with unrestricted features. After that period TexturePacker goes into Essential mode. It is restricted to basic features. If you use Pro features in this mode, you will get a warning before publishing and

some of your sprites will turn red in the output.

link 是 here