本文整理汇总了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)));
}
示例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);
}
示例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));
}
示例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);
}
}