当前位置: 首页>>代码示例>>C++>>正文


C++ CCProgressTimer类代码示例

本文整理汇总了C++中CCProgressTimer的典型用法代码示例。如果您正苦于以下问题:C++ CCProgressTimer类的具体用法?C++ CCProgressTimer怎么用?C++ CCProgressTimer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CCProgressTimer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CCLog

void ControllPanel::makeSkillCD(CCObject *pSender)
{
	CCLog("makeSkillCD");
	//进入CD状态
	this->setMagicCD(true);
	//设置按钮不可用
	m_pMagicItem->setIsEnabled(false);

	//创建技能cd样式
	CCProgressTimer *cd = CCProgressTimer::progressWithFile("actor_btn_mask.png");
	cd->setType(kCCProgressTimerTypeRadialCCW);
	cd->setPosition(m_pMagicItem->getParent()->getPosition());
	cd->setPercentage(99.99f);
	this->addChild(cd, 1000);
	//技能冷却动画
	CCProgressTo *to = CCProgressTo::actionWithDuration(PlayerMrg::getInstance()->getPlayer()->getPlayerSkillCd(), 0);
	//冷却完成之后的回调,销毁对象,同时使技能按钮可用
	CCCallFuncND *callfunn = CCCallFuncND::actionWithTarget(this, callfuncND_selector(ControllPanel::endSkillCD), (void*)cd);
	 
	cd->runAction(CCSequence::actions(to, callfunn, NULL));

	m_lMagicCDLabel->setIsVisible(true);
	schedule(schedule_selector(ControllPanel::updateCountDown), 1.0f);

}
开发者ID:david4750,项目名称:ShootGame,代码行数:25,代码来源:ControllPanel.cpp

示例2: addChild

//------------------------------------------------------------------
//
// SpriteProgressToRadialMidpointChanged
//
//------------------------------------------------------------------
void SpriteProgressToRadialMidpointChanged::onEnter()
{
    SpriteDemo::onEnter();

    CCSize s = CCDirector::sharedDirector()->getWinSize();

    CCProgressTo *action = CCProgressTo::create(2, 100);

    /**
   *  Our image on the left should be a radial progress indicator, clockwise
   */
    CCProgressTimer *left = CCProgressTimer::create(CCSprite::create(s_pPathBlock));
    left->setType(kCCProgressTimerTypeRadial);
    addChild(left);
    left->setMidpoint(ccp(0.25f, 0.75f));
    left->setPosition(ccp(100, s.height/2));
    left->runAction(CCRepeatForever::create((CCActionInterval *)action->copy()->autorelease()));

    /**
   *  Our image on the left should be a radial progress indicator, counter clockwise
   */
    CCProgressTimer *right = CCProgressTimer::create(CCSprite::create(s_pPathBlock));
    right->setType(kCCProgressTimerTypeRadial);
    right->setMidpoint(ccp(0.75f, 0.25f));

    /**
   *  Note the reverse property (default=NO) is only added to the right image. That's how
   *  we get a counter clockwise progress.
   */
    addChild(right);
    right->setPosition(ccp(s.width-100, s.height/2));
    right->runAction(CCRepeatForever::create((CCActionInterval *)action->copy()->autorelease()));
}
开发者ID:DangoXJ,项目名称:TuJinZhi,代码行数:38,代码来源:ActionsProgressTest.cpp

示例3: addChild

//******************************************************************************
// skillDecCD
//******************************************************************************
void Card::skillDecCD(int cd)
{
    CCSprite* spWhite = CCSprite::spriteWithFile("headw.png");
    if (spWhite) {
        addChild(spWhite, 2, kToBeDeleteTag);
        spWhite->setPositionInPixels(CCPointMake(55 + 106*m_idx, 615));
        spWhite->setIsVisible(false);
        spWhite->runAction(CCSequence::actions(CCDelayTime::actionWithDuration(0.7),
                                               CCShow::action(),
                                               CCFadeIn::actionWithDuration(0.15),
                                               CCFadeOut::actionWithDuration(0.15),
                                               CCCallFunc::actionWithTarget(this, callfunc_selector(Card::delUnusedObj)),
                                               NULL));
        
        CCProgressTimer* tmOrange = CCProgressTimer::progressWithFile("heado.png");
        if (tmOrange) {
            addChild(tmOrange, 2, kToBeDeleteTag);
            tmOrange->setPositionInPixels(CCPointMake(55 + 106*m_idx, 615));
            tmOrange->setType(kCCProgressTimerTypeRadialCCW);
            tmOrange->setPercentage(99);
            tmOrange->runAction(CCProgressTo::actionWithDuration(0.7, 0));
        }
    }
    
    m_iSklCdDwn = cd;
    m_iCurSkillCD = MIN(m_iCurSkillCD.get(), (m_iSkillCDMax - m_iSklCdDwn));
}
开发者ID:haoliumilan,项目名称:AgainstSango,代码行数:30,代码来源:Card.cpp

示例4: createRedStartPrompt

CCProgressTimer* SectionGuide::createRedStartPrompt()
{
    CCSprite* sprite = CCSprite::create(ResManager::getManager()->getSharedFilePath("circle.png").c_str());
    CCProgressTimer *progress = CCProgressTimer::create(sprite);
    progress->setType( kCCProgressTimerTypeRadial );
    progress->setVisible(false);
    return progress;
}
开发者ID:SongCF,项目名称:game-LostStar,代码行数:8,代码来源:SectionGuide.cpp

示例5: setOpacity

void
MCSkillBarItem::coldTimeDidFinish(CCObject *anObject)
{
    CCProgressTimer *progressTimer = dynamic_cast<CCProgressTimer *>(anObject);
    
    progressTimer->removeFromParentAndCleanup(true);
    setOpacity(kMCSkillBarItemActiveSkillOpacity);
}
开发者ID:edison9888,项目名称:__graduation_project,代码行数:8,代码来源:MCSkillBar.cpp

示例6: createProgressTimer

CCProgressTimer* createProgressTimer(CCSprite* sprite)
{
	CCProgressTimer *progress = CCProgressTimer::create(sprite);
	progress->setType( kCCProgressTimerTypeBar );
	progress->setMidpoint(ccp(0,0));
	progress->setBarChangeRate(ccp(1, 0));
	return progress;
}
开发者ID:SongCF,项目名称:game-LostStar,代码行数:8,代码来源:LFUtile.cpp

示例7: changeEnergyBarAnimation

void ASBot::changeEnergyBarAnimation(int _dif){
    
    CCProgressTimer* energyBar = (CCProgressTimer*)this->getChildByTag(2*10000000+20);
    int percentage = energyBar->getPercentage();
    
    CCProgressFromTo* action = CCProgressFromTo::create(0.015*(abs(moveCount*100/moveToFight-percentage)), percentage, moveCount*100/moveToFight);
    CCSequence* seq = CCSequence::create(action,NULL);
    energyBar->runAction(seq);
}
开发者ID:nooboracle,项目名称:ForTest,代码行数:9,代码来源:ASBotEnergyBar.cpp

示例8: createRedStartToTableArrows

CCProgressTimer* SectionGuide::createRedStartToTableArrows()
{
    CCSprite* sprite = CCSprite::create(ResManager::getManager()->getSharedFilePath("arrows.png").c_str());
    CCProgressTimer *progress = CCProgressTimer::create(sprite);
    progress->setType( kCCProgressTimerTypeBar );
    progress->setVisible(false);
    progress->setMidpoint(ccp(0,1));
    progress->setBarChangeRate(ccp(0, 1));
    return progress;
}
开发者ID:SongCF,项目名称:game-LostStar,代码行数:10,代码来源:SectionGuide.cpp

示例9: endNode

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);
}
开发者ID:zhaxun,项目名称:cocos2d,代码行数:10,代码来源:ccMiscNodeCreator.cpp

示例10: CCProgressTimer

CCProgressTimer* CCProgressTimerCreator::createNode()
{
    CCProgressTimer* pProgressTimer = new CCProgressTimer();
    if(pProgressTimer)
    {
        pProgressTimer->autorelease();
        return pProgressTimer;
    }
    CC_SAFE_DELETE(pProgressTimer);
    return NULL;
}
开发者ID:zhaxun,项目名称:cocos2d,代码行数:11,代码来源:ccMiscNodeCreator.cpp

示例11: JDCallback

//进度动作  
void HelloWorld::JDCallback(CCObject* pSender)  
{  
    CCProgressTo *to1 = CCProgressTo::actionWithDuration(2,100); 
	CCSprite *jl=CCSprite::spriteWithFile("jl.png");

    CCProgressTimer *left = CCProgressTimer::progressWithSprite(jl);  
    left->setType(kCCProgressTimerTypeBar);  
    addChild(left);  
    left->setPosition(CCPointMake(100,s.height/2));  
    left->runAction(CCRepeatForever::actionWithAction(to1));  
}  
开发者ID:zhengpeiyang,项目名称:cocosLearn,代码行数:12,代码来源:HelloWorldScene.cpp

示例12: loadCallBack

void LoadingLayer::loadCallBack(CCObject* ped)
{
    loadingNum++;
    CCProgressTimer* pt = (CCProgressTimer*)this->getChildByTag(1);
    //float now = pt->getPercentage();
    pt->setPercentage(loadingNum/totalNum);
    if(loadingNum < totalNum){
	CCLOG("loading...");
    }else{
	CCLOG("loading over");
    }
}
开发者ID:hzfeibao,项目名称:Defender,代码行数:12,代码来源:LoadingLayer.cpp

示例13: CCProgressTimer

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;
}
开发者ID:IppClub,项目名称:Dorothy,代码行数:15,代码来源:CCProgressTimer.cpp

示例14: startWithTarget

void CCProgressTo::startWithTarget(CCNode* pTarget)
{
	CCProgressTimer* progressTimer = dynamic_cast<CCProgressTimer*>(pTarget);
	if (progressTimer)
	{
    	CCActionInterval::startWithTarget(pTarget);
	    m_fFrom = progressTimer->getPercentage();
    	// XXX: Is this correct ?
    	// Adding it to support CCRepeat
    	if (m_fFrom == 100)
    	{
			m_fFrom = 0;
    	}
	}
}
开发者ID:IppClub,项目名称:Dorothy,代码行数:15,代码来源:CCActionProgressTimer.cpp

示例15: addChild

void
MCSkillBarItem::intoColdTime()
{
    CCSprite *coldSprite = CCSprite::create(kMCColdTimeSkillIconFilepath);
    CCProgressTimer *progressTimer = CCProgressTimer::create(coldSprite);
    
    progressTimer->setReverseProgress(true);
    progressTimer->setAnchorPoint(CCPointZero);
    addChild(progressTimer);
    
    setOpacity(kMCSkillBarItemColdTimeOpacity);
    progressTimer->runAction(CCSequence::createWithTwoActions(CCProgressFromTo::create(skill_->coldTime, 100.f, 0.0f),
                                                              CCCallFuncO::create(this,
                                                                                  callfuncO_selector(MCSkillBarItem::coldTimeDidFinish),
                                                                                  progressTimer)));
}
开发者ID:edison9888,项目名称:__graduation_project,代码行数:16,代码来源:MCSkillBar.cpp


注:本文中的CCProgressTimer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。