Exemple #1
0
CScale9Sprite* CScale9Sprite::resizableSpriteWithCapInsets(Rect capInsets)
{
    CScale9Sprite* pReturn = new CScale9Sprite();
    if ( pReturn && pReturn->initWithBatchNode(_scale9Image, m_spriteRect, capInsets) )
    {
        pReturn->autorelease();
        return pReturn;
    }
    CC_SAFE_DELETE(pReturn);
    return NULL;
}
Exemple #2
0
CScale9Sprite* CScale9Sprite::create()
{ 
    CScale9Sprite *pReturn = new CScale9Sprite();
    if (pReturn && pReturn->init())
    { 
        pReturn->autorelease();   
        return pReturn;
    } 
    CC_SAFE_DELETE(pReturn);
    return NULL;
}
Exemple #3
0
CScale9Sprite* CScale9Sprite::createWithTexture(Texture2D* pTexture, Rect capInsets)
{
	CScale9Sprite* pReturn = new CScale9Sprite();
    if ( pReturn && pReturn->initWithTexture(pTexture, capInsets) )
    {
        pReturn->autorelease();
        return pReturn;
    }
    CC_SAFE_DELETE(pReturn);
    return NULL;
}
Exemple #4
0
CScale9Sprite* CScale9Sprite::createWithSpriteFrameName(const char* spriteFrameName, Rect capInsets)
{
    CScale9Sprite* pReturn = new CScale9Sprite();
    if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName, capInsets) )
    {
        pReturn->autorelease();
        return pReturn;
    }
    CC_SAFE_DELETE(pReturn);
    return NULL;
}
Exemple #5
0
CScale9Sprite* CScale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame)
{
    CScale9Sprite* pReturn = new CScale9Sprite();
    if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame) )
    {
        pReturn->autorelease();
        return pReturn;
    }
    CC_SAFE_DELETE(pReturn);
    return NULL;
}
Exemple #6
0
CScale9Sprite* CScale9Sprite::create(const char* file)
{
    CScale9Sprite* pReturn = new CScale9Sprite();
    if ( pReturn && pReturn->initWithFile(file) )
    {
        pReturn->autorelease();
        return pReturn;
    }
    CC_SAFE_DELETE(pReturn);
    return NULL;
}
Exemple #7
0
CScale9Sprite* CScale9Sprite::createWithSpriteFrameName(const char* spriteFrameName)
{
    CCAssert(spriteFrameName != NULL, "spriteFrameName must be non-NULL");

    CScale9Sprite* pReturn = new CScale9Sprite();
    if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName) )
    {
        pReturn->autorelease();
        return pReturn;
    }
    CC_SAFE_DELETE(pReturn);

    log("Could not allocate CScale9Sprite()");
    return NULL;
}