Пример #1
0
Scale9Sprite* Scale9Sprite::create(const std::string& file)
{
    Scale9Sprite* pReturn = new Scale9Sprite();
    if ( pReturn && pReturn->initWithFile(file) )
    {
        pReturn->autorelease();
        return pReturn;
    }
    CC_SAFE_DELETE(pReturn);
    return NULL;
}
Пример #2
0
Scale9Sprite* Scale9Sprite::create(const std::string& file, const Rect& rect)
{
    Scale9Sprite* pReturn = new Scale9Sprite();
    if ( pReturn && pReturn->initWithFile(file, rect) )
    {
        pReturn->autorelease();
        return pReturn;
    }
    CC_SAFE_DELETE(pReturn);
    return nullptr;
}
Пример #3
0
 Scale9Sprite* Scale9Sprite::create(const Rect& capInsets, const std::string& file)
 {
     Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite();
     if ( pReturn && pReturn->initWithFile(capInsets, file) )
     {
         pReturn->autorelease();
         return pReturn;
     }
     CC_SAFE_DELETE(pReturn);
     return NULL;
 }
Пример #4
0
Scale9Sprite* Scale9Sprite::create(const Rect& capInsets, const std::string& file)
{
    Scale9Sprite* ret = new (std::nothrow) Scale9Sprite();
    if (ret && ret->initWithFile(capInsets, file))
    {
        ret->autorelease();
        return ret;
    }
    CC_SAFE_DELETE(ret);
    return nullptr;
}