createWithSpriteFrameName nullptr

来源:互联网 发布:淘宝上磁疗贴商品标题 编辑:程序博客网 时间:2024/05/15 15:41

bool WelcomeLayer::init()
{
bool bl = Layer::init();
//缓存纹理
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(“gameArts-hd.plist”);
//加入背景
Sprite *background = Sprite::createWithSpriteFrameName(“background_2.png”);
this->addChild(background);
// background->setAnchorPoint(Point(0, 0));
return bl;
}

文件资源错误!

0 0