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


C++ CCProgressTimer::setReverseProgress方法代码示例

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


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

示例1: 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

示例2: skillCoolHandler

void OptionLayer::skillCoolHandler(CCObject* pSender)
{
    OptionLayer *optionLayer = global->optionLayer;
    UIImageView* skillView = (UIImageView*)pSender;
    global->hero->setAllowMove(false);//动画执行期间角色不可移动
    float SumCD = 10.0f;
    //判断指向对象是否相等来初始化cd时间
    if(optionLayer->getSkill_attack_1() == skillView){
        SumCD = optionLayer->skill_SumCD_1;
        global->hero->RunAttackAction_1();		//执行特殊攻击1动画
    }else if(optionLayer->getSkill_attack_2() == skillView){
        SumCD = optionLayer->skill_SumCD_2;
    }else if(optionLayer->getSkill_attack_3() == skillView){
        SumCD = optionLayer->skill_SumCD_3;
    }else if(optionLayer->getSkill_attack() == skillView){
        SumCD = optionLayer->skill_SumCD_0;
        global->hero->RunAttackAction();		//执行普通攻击动画
    }else if(optionLayer->getBlood_bottle() == skillView){
        SumCD = optionLayer->blood_SumCD;
    }else if(optionLayer->getMagic_bottle() == skillView){
        SumCD = optionLayer->magic_SumCD;
    }
    skillView->setTouchEnabled(false);		//CD开始,禁止本技能使用
    //初始化 cd遮罩
    CCTexture2D *spriteTx = CCTextureCache::sharedTextureCache()->addImage("Skill_UI/cooling_cover.png");
    CCSprite * SkillCover = CCSprite::createWithTexture(spriteTx);
    CCProgressTimer *skillTimer  = CCProgressTimer::create(SkillCover);
    skillTimer->setOpacity(125);							//透明度
    skillTimer->setPosition(skillView->getPosition());//将进度遮罩设置在技能图标位置上
    optionLayer->getSkillUI()->addChild(skillTimer);
    
    skillTimer->setType(kCCProgressTimerTypeRadial);//扇形
    skillTimer->setPercentage(100);
    skillTimer->setReverseProgress(true);
    
    CCProgressTo* cdAction=CCProgressTo::create(SumCD, 100);
    CCCallFuncND* func=CCCallFuncND::create(this, callfuncND_selector(OptionLayer::allowToClick),skillView);//附带skillView参数 方便cd结束后处理
    CCFiniteTimeAction* seq=CCSequence::create(cdAction,func,NULL);
    skillTimer->runAction(seq);
}
开发者ID:HUjinshuai,项目名称:-,代码行数:40,代码来源:OptionLayer.cpp

示例3: onEnter

//------------------------------------------------------------------
//
// SpriteProgressToRadial
//
//------------------------------------------------------------------
void SpriteProgressToRadial::onEnter()
{
    SpriteDemo::onEnter();
    
    CCSize s = CCDirector::sharedDirector()->getWinSize();

    CCProgressTo *to1 = CCProgressTo::create(2, 100);
    CCProgressTo *to2 = CCProgressTo::create(2, 100);

    CCProgressTimer *left = CCProgressTimer::create(CCSprite::create(s_pPathSister1));
    left->setType( kCCProgressTimerTypeRadial );
    addChild(left);
    left->setPosition(CCPointMake(100, s.height/2));
    left->runAction( CCRepeatForever::create(to1));
    
    CCProgressTimer *right = CCProgressTimer::create(CCSprite::create(s_pPathBlock));
    right->setType(kCCProgressTimerTypeRadial);
    // Makes the ridial CCW
    right->setReverseProgress(true);
    addChild(right);
    right->setPosition(CCPointMake(s.width-100, s.height/2));
    right->runAction( CCRepeatForever::create(to2));
}
开发者ID:DangoXJ,项目名称:TuJinZhi,代码行数:28,代码来源:ActionsProgressTest.cpp

示例4: setAttribute

void CCProgressTimerCreator::setAttribute(CCNode* pNode, const char* strName, const char* strValue, bool bCache)
{
    if(bCache)
        mAttrMap[strName] = strValue;

    else
    {
        CCProgressTimer* pProgressTimer = (CCProgressTimer*)pNode;
        if(strcmp(strName, "file") == 0 || strcmp(strName, "plist") == 0 )
            return;

        if(strcmp(strName, "type") == 0)
            pProgressTimer->setType((CCProgressTimerType)ccXmlAttrParse::toInt(strValue));

        if(strcmp(strName, "percent") == 0)
            pProgressTimer->setPercentage(ccXmlAttrParse::toFloat(strValue));

        if(strcmp(strName, "midpos") == 0)
            pProgressTimer->setMidpoint(ccXmlAttrParse::toPoint(strValue));

        if(strcmp(strName, "rate") == 0)
            pProgressTimer->setBarChangeRate(ccXmlAttrParse::toPoint(strValue));

        if(strcmp(strName, "reverse") == 0)
            pProgressTimer->setReverseProgress(ccXmlAttrParse::toBool(strValue));

        if(strcmp(strName, "anchor") == 0)
            pProgressTimer->setAnchorPoint(ccXmlAttrParse::toPoint(strValue));

        if(strcmp(strName, "color") == 0)
            pProgressTimer->setColor(ccXmlAttrParse::toColor3B(strValue));

        else
            CCNodeRGBACreator::setAttribute(pNode, strName, strValue, bCache);
    }
}
开发者ID:zhaxun,项目名称:cocos2d,代码行数:36,代码来源:ccMiscNodeCreator.cpp


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