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