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


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

本文整理汇总了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;
}
开发者ID:chhao,项目名称:CombatDemo,代码行数:50,代码来源:BattleLayer.cpp

示例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);
}
开发者ID:anarki1234,项目名称:9miao,代码行数:43,代码来源:CCTransitionProgress.cpp


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