I create a CCSprite, but I want to set its texture then.I write the code like below:
CCSprite sprite=CCSprite::create;
……
sprite~~>setTexture;
Unfortunetly, the sprite will not be displayed on screen even I explicitly call sprite~~>setVisible,but when I write code like below,the sprite will be displayed:
CCSpritesprite=CCSprite::createWithTexture(stubTexture);
……
sprite->setTexture(myTexture);
I just don’t know why should I assign an initial texture when creating a sprite if I want to reset its texture then and let it be displayed? is this a bug for sprite?