CCScale9Sprite* CCScale9Sprite::resizableSpriteWithCapInsets(CCRect capInsets) { CCScale9Sprite* pReturn = new CCScale9Sprite(); if ( pReturn && pReturn->initWithBatchNode(_scale9Image, m_spriteRect, capInsets) ) { pReturn->autorelease(); return pReturn; } CC_SAFE_DELETE(pReturn); return NULL; }
CCScale9Sprite* CCScale9Sprite::create() { CCScale9Sprite *pReturn = new CCScale9Sprite(); if (pReturn && pReturn->init()) { pReturn->autorelease(); return pReturn; } CC_SAFE_DELETE(pReturn); return NULL; }
CCScale9Sprite* CCScale9Sprite::createWithSpriteFrameName(const char* spriteFrameName, CCRect capInsets) { CCScale9Sprite* pReturn = new CCScale9Sprite(); if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName, capInsets) ) { pReturn->autorelease(); return pReturn; } CC_SAFE_DELETE(pReturn); return NULL; }
CCScale9Sprite* CCScale9Sprite::createWithSpriteFrame(CCSpriteFrame* spriteFrame) { CCScale9Sprite* pReturn = new CCScale9Sprite(); if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame) ) { pReturn->autorelease(); return pReturn; } CC_SAFE_DELETE(pReturn); return NULL; }
CCScale9Sprite* CCScale9Sprite::create(const char* file) { CCScale9Sprite* pReturn = new CCScale9Sprite(); if ( pReturn && pReturn->initWithFile(file) ) { pReturn->autorelease(); return pReturn; } CC_SAFE_DELETE(pReturn); return NULL; }
CCScale9Sprite* CCScale9Sprite::createWithImage(CAImage* texture) { CCScale9Sprite* pReturn = new CCScale9Sprite(); if (pReturn && pReturn->initWithImage(texture)) { pReturn->autorelease(); return pReturn; } CC_SAFE_DELETE(pReturn); return NULL; }
CCScale9Sprite* CCScale9Sprite::createWithSpriteFrameName(const char* spriteFrameName) { CCAssert(spriteFrameName != NULL, "spriteFrameName must be non-NULL"); CCScale9Sprite* pReturn = new CCScale9Sprite(); if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName) ) { pReturn->autorelease(); return pReturn; } CC_SAFE_DELETE(pReturn); CCLog("Could not allocate CCScale9Sprite()"); return NULL; }