今天写cocos2d-x发现了一个奇怪的问题,具体描述如下:
我的资源文件里有一张图片“player.png”
首先我creat了一个精灵并add到渲染层;
m_forward = Forward::create("Player.png");
this->addChild(m_forward);
其后马上为精灵加上动画
<span style="white-space:pre"> </span>CCAnimation* animation = CCAnimation::create();
animation->addSpriteFrameWithFileName(<span style="color:#ff0000;">"Player.png"</span>);
animation->addSpriteFrameWithFileName(<span style="color:#ff0000;">"Player-2.png"</span>);
animation->setDelayPerUnit(0.2f);
this->runAction(CCRepeatForever::create(CCAnimate::creat

在cocos2d-x开发中遇到图片资源“player.png”加载异常的问题,起初以为与动画播放有关,实际是由于Windows系统不区分文件名大小写,但在Android上区分大小写,导致“Player.png”无法找到,引发运行时错误。解决方案是确保所有平台上的资源文件名大小写一致。

492

被折叠的 条评论
为什么被折叠?



