SpriteAnimation* SpriteAnimation::create(const std::string& plist, float delay)
{
    SpriteAnimation* ret = new SpriteAnimation();
    if (ret && ret->init(plist, delay))
    {
        ret->autorelease();
        return ret;
    }
    else
    {
        delete ret;
        return nullptr;
    }
}
Esempio n. 2
0
SpriteAnimation* SpriteAnimation::create(const char* plist, bool repeat)
{
    SpriteAnimation *pRet = new SpriteAnimation();
    if (pRet && pRet->init(plist, repeat))
    {
        pRet->autorelease();
        return pRet;
    }
    else
    {
        delete pRet;
        pRet = NULL;
        return NULL;
    }
}