CCSpriteEx* CCSpriteEx::createWithSpriteFrame(CCSpriteFrame *pSpriteFrame) { CCSpriteEx *pobSprite = new CCSpriteEx(); if (pSpriteFrame && pobSprite && pobSprite->initWithSpriteFrame(pSpriteFrame)) { pobSprite->autorelease(); return pobSprite; } CC_SAFE_DELETE(pobSprite); return NULL; }
CCSpriteEx* CCSpriteEx::createWithTexture(CCTexture2D *pTexture, const CCRect& rect) { CCSpriteEx *pobSprite = new CCSpriteEx(); if (pobSprite && pobSprite->initWithTexture(pTexture, rect)) { pobSprite->autorelease(); return pobSprite; } CC_SAFE_DELETE(pobSprite); return NULL; }
CCSpriteEx* CCSpriteEx::create(const char *pszFileName, const CCRect& rect) { CCSpriteEx *pobSprite = new CCSpriteEx(); if (pobSprite && pobSprite->initWithFile(pszFileName, rect)) { pobSprite->autorelease(); return pobSprite; } CC_SAFE_DELETE(pobSprite); return NULL; }
CCSpriteEx* CCSpriteEx::create() { CCSpriteEx *pSprite = new CCSpriteEx(); if (pSprite && pSprite->init()) { pSprite->autorelease(); return pSprite; } CC_SAFE_DELETE(pSprite); return NULL; }