CCSprite 用法问题

//标准做法
CCSprite* pSprite = CCSprite::create(“HelloWorld.png”);

//这样做也可以,但是需要一张站位图片
CCSprite* pSprite = CCSprite::create(“null.png”);
cocos2d::CCTexture2D * ptexture = CCTextureCache::sharedTextureCache()->addImage(“HelloWorld.png”);
pSprite->setTexture(ptexture);

//这样不显示,要怎么改???
CCSprite* pSprite = CCSprite::create();
cocos2d::CCTexture2D * ptexture = CCTextureCache::sharedTextureCache()->addImage(“HelloWorld.png”);
pSprite->setTexture(ptexture);

Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename);
setTexture(texture);

Rect rect = Rect::ZERO;
rect.size = texture->getContentSize();
setTextureRect(rect);

如果是3.x,直接用setTexture(filename);