本文整理汇总了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);
}
示例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()));
}
示例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));
}
示例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;
}
示例5: setOpacity
void
MCSkillBarItem::coldTimeDidFinish(CCObject *anObject)
{
CCProgressTimer *progressTimer = dynamic_cast<CCProgressTimer *>(anObject);
progressTimer->removeFromParentAndCleanup(true);
setOpacity(kMCSkillBarItemActiveSkillOpacity);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例10: CCProgressTimer
CCProgressTimer* CCProgressTimerCreator::createNode()
{
CCProgressTimer* pProgressTimer = new CCProgressTimer();
if(pProgressTimer)
{
pProgressTimer->autorelease();
return pProgressTimer;
}
CC_SAFE_DELETE(pProgressTimer);
return NULL;
}
示例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));
}
示例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");
}
}
示例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;
}
示例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;
}
}
}
示例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)));
}