您的位置:首页 > 其它

更换图片

2015-10-29 18:31 232 查看
CCSpriteBatchNode *spriteBatch=CCSpriteBatchNode::batchNodeWithFile("********.png");

this->addChild(spriteBatch);

//加载plist

CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("myconfig.plist");

// 生成Sprite

CCSprite *headSprite=CCSprite::spriteWithSpriteFrameName("aaa.png");

//需要更换图片时

CCSpriteFrame *frame=CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("bbb.png");

headSprite->setDisplayFrame(frame);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: