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


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

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


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

示例1: energyBarAnimation

void ASGame::energyBarAnimation(){
    
    //1.显示行动力的圆形底座
    CCSprite* energyBall = CCSprite::createWithSpriteFrameName("newEnergyContainer.png");
    energyBall->setPosition(ccp(size.width*17.38/80,size.height*77.85/90+winDif*2*alpha*alpha));
    addChild(energyBall,4);
    
    //2.行动力数量
    string perStr = int2string(moveCount);
    CCLabelTTF* per = CCLabelTTF::create(perStr.c_str(),"Arial Rounded MT bold",32);
    per->setPosition(ccp(size.width*17.38/80,size.height*77.85/90+winDif*2*alpha*alpha));
    addChild(per,5,1*10000000+26);
    
    //3.能量条
    CCSprite* energyBarSprite = CCSprite::createWithSpriteFrameName("newEnergyBar.png");
    CCProgressTimer* energyBar = CCProgressTimer::create(energyBarSprite);
    energyBar->setPosition(ccp(size.width*8.45/80,size.height*79.89/90+winDif*2*alpha*alpha));
    energyBar->setType(kCCProgressTimerTypeRadial);
    energyBar->setPercentage(moveCount*20);
    addChild(energyBar,4,1*10000000+20);
    
    //4.攻击按钮底座
    CCSprite* containerSprite = CCSprite::createWithSpriteFrameName("energyContainer.png");
    CCSprite* containerSprite_s = CCSprite::createWithSpriteFrameName("energyContainer.png");
    CCMenuItemSprite* energyContainer = CCMenuItemSprite::create(containerSprite,containerSprite_s,this,menu_selector(ASGame::enterFightLayer));
    energyContainer->setScale(1.05);
    energyContainer->setPosition(ccp(size.width*179.5/200,size.height*10.25/135));
    CCMenu* energyContainerMenu = CCMenu::create(energyContainer,NULL);
    energyContainerMenu->setPosition(CCPointZero);
    if (moveCount < moveToFight)
            energyContainerMenu->setTouchEnabled(false);
    addChild(energyContainerMenu,2,1*10000000+27);
    
    //5.攻击按钮充值槽
    CCSprite* barSprite = CCSprite::createWithSpriteFrameName("energyBar.png");
    CCProgressTimer* attackButton = CCProgressTimer::create(barSprite);
    attackButton->setScale(1.05);
    attackButton->setPosition(ccp(size.width*179.04/200,size.height*10/135));
    attackButton->setType(kCCProgressTimerTypeBar);
    attackButton->setMidpoint(ccp(0.5, 0));
    attackButton->setBarChangeRate(ccp(0, 1));
    attackButton->setPercentage(100*moveCount/moveToFight);
    addChild(attackButton,3,1*10000000+25);
    
    //4.能量的盖子
    CCSprite* energyBarCover = CCSprite::createWithSpriteFrameName("energyBarCover.png");
    energyBarCover->setPosition(ccp(size.width*179.5/200,size.height*10.25/135));
    energyBarCover->setOpacity(0);
    //addChild(energyBarCover,4,1*10000000+28);
}
开发者ID:nooboracle,项目名称:ForTest,代码行数:50,代码来源:ASEnergyBar.cpp

示例2: auto_pz


//.........这里部分代码省略.........
                    this->removeChild(sprinte_11_a, true);
                    this->removeChild(sprinte_11_b, true);
                    this->removeChild(sprinte_11_y_a, true);
                    this->removeChild(sprinte_11_y_b, true);
                    CCProgressTimer *pt = (CCProgressTimer*)getChildByTag(71);
                    if(pt)
                    {
                        this->removeChild(pt, true);
                    }
                    game_bj::e_11 = 100;

                }
                CCProgressTimer *pt = (CCProgressTimer*)getChildByTag(71);
                if(pt)
                {
                    pt->setPercentage(game_bj::e_11);
                    pt->setPosition( ccp(point.x, point.y-20) );
                    pt->setType(kCCProgressTimerTypeBar);
                    CCFiniteTimeAction *action_1 = CCMoveTo::create((7*(point.y-1))/520,ccp(point.x,1));
                    pt->runAction(action_1);

                    CCProgressTo *to = CCProgressTo::actionWithDuration(0.1, new_value_11);
                    pt->runAction(to);
                    game_bj::e_11 = game_bj::e_11-10;
                } else
                {
                    CCSprite *sprinte_11 = (CCSprite*)getChildByTag(11);
                    if(sprinte_11)
                    {
                        CCProgressTimer *pt = CCProgressTimer::progressWithSprite(CCSprite::create("hatchling_exp_02.png"));
                        pt->setPercentage(game_bj::e_11);
                        pt->setPosition( ccp(point.x, point.y-20) );
                        pt->setType(kCCProgressTimerTypeBar);
                        pt->setScale(0.4);
                        pt->setMidpoint(ccp(0,0));
                        pt->setBarChangeRate(ccp(1,0));
                        this->addChild(pt,0,71);
                        CCFiniteTimeAction *action_1 = CCMoveTo::create((7*(point.y-1))/520,ccp(point.x,1));
                        pt->runAction(action_1);

                        CCProgressTo *to = CCProgressTo::actionWithDuration(0.1, new_value_11);
                        pt->runAction(to);
                        game_bj::e_11 = game_bj::e_11-10;
                    }

                }






                CCSprite *item_gb = new CCSprite();
                item_gb->initWithFile("item_coin.png");
                item_gb->setPosition( ccp(point.x, point.y) );
                item_gb->setScale(game_bj::scale);
                this->addChild(item_gb, 0,61);
                CCJumpTo* mJumpTo = CCJumpTo::actionWithDuration(2.0f, ccp(280, 1), 230.0f, 1);
                CCActionInterval*  seq_aa = (CCActionInterval*)(CCSequence::actions(mJumpTo, NULL));
                item_gb->runAction(seq_aa);
            }

            if(ret_2)
            {
                CCPoint point = sprinte_12->getPosition();
                CCLOG("2");
开发者ID:nodephp,项目名称:fly,代码行数:67,代码来源:game_bj.cpp


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