Hello.
I try to change texture in my sprite on the fly. Here is my code:
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("img/share_atlas.plist", "img/share_atlas.png");
CCSprite *pView = CCSprite::spriteWithSpriteFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("grid.png"));
//OK sprite is white quad - grid.png
CCSprite *pGreen = CCSprite::spriteWithSpriteFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("green.png"));
pView->setTexture(pGreen->getTexture());
//NOT OK sprite still white
pGreen = CCSprite::spriteWithFile("green.png");
pView->setTexture(pGreen->getTexture());
//OK sprite is green
But i like to use sprite atlas, and dont like use standalone sprites;