Exemple #1
0
void CCProgressTimerCreator::endNode(CCNode* pNode)
{
    CCProgressTimer* pProgressTimer = (CCProgressTimer*)pNode;
    if(FIND_OBJ_BYKEY(mAttrMap, "file"))
        pProgressTimer->initWithSprite(CCSprite::create(mAttrMap["file"].c_str()));
    else if(FIND_OBJ_BYKEY(mAttrMap, "plist"))
        pProgressTimer->initWithSprite(CCSprite::createWithSpriteFrameName(mAttrMap["plist"].c_str()));

    CCNodeCreator::setAttribute(pNode);
}
Exemple #2
0
CCProgressTimer* CCProgressTimer::create(CCSprite* sp, CCProgressTimerType type)
{
    CCProgressTimer* pProgressTimer = new CCProgressTimer();
    if (pProgressTimer->initWithSprite(sp))
    {
        pProgressTimer->autorelease();
    }
    else
    {
        delete pProgressTimer;
        pProgressTimer = NULL;
    }        
	pProgressTimer->setType(type);
    return pProgressTimer;
}