1、更换图片
CCSprite * pImage = CCSprite::create("image.png");
CCTexture2D * text2d = CCTextureCache::sharedTextureCache()->addImage("other.png");
pImage->setTexture(text2d);
CCRect rect = CCRect(0, 0, text2d->getContentSize().width, text2d->getContentSize().height);
pImage->setTextureRect(rect); // 要设置这个,图片才能保持other.png图片的大小,而且这句要在setTexture之后
2、清空图片
pImage->setTexture(NULL);
pImage->setTextureRect(CCRect());