B2Sprite* B2Sprite::createWithTexture(CCTexture2D *pTexture, const CCRect& rect) { B2Sprite* pRet = new B2Sprite(); if (pRet && pRet->initWithTexture(pTexture, rect)) { pRet->autorelease(); } else { CC_SAFE_DELETE(pRet); } return pRet; }
B2Sprite* B2Sprite::create(const char *pszFileName, const CCRect& rect) { B2Sprite* pRet = new B2Sprite(); if (pRet && pRet->initWithFile(pszFileName, rect)) { pRet->autorelease(); } else { CC_SAFE_DELETE(pRet); } return pRet; }
B2Sprite* B2Sprite::create() { B2Sprite* pRet = new B2Sprite(); if (pRet && pRet->init()) { pRet->autorelease(); } else { CC_SAFE_DELETE(pRet); } return pRet; }
B2Sprite* B2Sprite::createWithSpriteFrameName(const char *pszSpriteFrameName) { B2Sprite* pRet = new B2Sprite(); if (pRet && pRet->initWithSpriteFrameName(pszSpriteFrameName)) { pRet->autorelease(); } else { CC_SAFE_DELETE(pRet); } return pRet; }