本文整理汇总了C++中CCProgressTimer::setTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CCProgressTimer::setTag方法的具体用法?C++ CCProgressTimer::setTag怎么用?C++ CCProgressTimer::setTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCProgressTimer
的用法示例。
在下文中一共展示了CCProgressTimer::setTag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool BattleLayer::init()
{
if(!CCLayer::init())
return false;
m_label = CCLabelTTF::create("第1波", "", 40);
m_label->setPosition(ccp(320,800));
m_label->retain();
addChild(m_label);
m_effectLabel = CCLabelTTF::create("", "", 30);
m_effectLabel->setPosition(ccp(320,750));
m_effectLabel->setColor(ccc3(255,0,0));
addChild(m_effectLabel);
m_guardLabel = CCLabelTTF::create("", "", 30);
m_guardLabel->setPosition(ccp(320,700));
m_guardLabel->setColor(ccc3(255,255,0));
addChild(m_guardLabel);
m_enemySprite = CCSprite::create("icons/0020.png");
m_enemySprite->retain();
CCSprite* hpbg = CCSprite::create("hpbar_bg.png");
CCProgressTimer* hpbar = CCProgressTimer::create(CCSprite::create("hpbar_fore.png"));
hpbg->setPosition(ccp(50,100));
hpbar->setPosition(ccp(50,100));
hpbar->setType(kCCProgressTimerTypeBar);
hpbar->setBarChangeRate(ccp(1,0));
hpbar->setPercentage(100);
hpbar->setMidpoint(CCPointZero);
hpbar->setTag(0);
m_enemySprite->addChild(hpbg);
m_enemySprite->addChild(hpbar);
addChild(m_enemySprite,SpritezOrder::Enemy);
m_cardbattleLayer = CardBattleLayer::create();
m_cardbattleLayer->retain();
m_setTrapLayer = SetTrapLayer::create();
addChild(m_setTrapLayer);
m_pauseSprite = CCSprite::create("pause.png");
m_pauseSprite->setPosition(ccp(590,910));
addChild(m_pauseSprite);
return true;
}
示例2: onEnter
// CCTransitionProgress
void CCTransitionProgress::onEnter()
{
CCTransitionScene::onEnter();
setupTransition();
// create a transparent color layer
// in which we are going to add our rendertextures
CCSize size = CCDirector::sharedDirector()->getWinSize();
// create the second render texture for outScene
CCRenderTexture *texture = CCRenderTexture::create((int)size.width, (int)size.height);
texture->getSprite()->setAnchorPoint(ccp(0.5f,0.5f));
texture->setCenterOrigin(ccp(size.width/2, size.height/2));
// render outScene to its texturebuffer
texture->clear(0, 0, 0, 1);
texture->begin();
m_pSceneToBeModified->visit();
texture->end();
// Since we've passed the outScene to the texture we don't need it.
if (m_pSceneToBeModified == m_pOutScene)
{
hideOutShowIn();
}
// We need the texture in RenderTexture.
CCProgressTimer *pNode = progressTimerNodeWithRenderTexture(texture);
// create the blend action
CCActionInterval* layerAction = (CCActionInterval*)CCSequence::create(
CCProgressFromTo::create(m_fDuration, m_fFrom, m_fTo),
CCCallFunc::create(this, callfunc_selector(CCTransitionProgress::finish)),
NULL);
// run the blend action
pNode->runAction(layerAction);
// add the layer (which contains our two rendertextures) to the scene
pNode->setTag(kCAWindowRadial);
this->insertSubview(pNode, 2);
}