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


C++ ProgressTimer::setType方法代码示例

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


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

示例1: cool

void SkillButton::cool(float time) {
    ProgressTimer *prog = static_cast<ProgressTimer *>(this->getChildByTag(PROGRESS_TAG));
    //判断之前是否已经设置了冷却效�?
    if (!prog) {
        prog = ProgressTimer::create(Sprite::create("image/1.png"));
        prog->setType( ProgressTimer::Type::RADIAL);
        prog->setTag(PROGRESS_TAG);
        this->addChild(prog);
        prog->setAnchorPoint(Vec2(0.f, 0.f));
        prog->setPosition(0.f, 0.f);
        prog->setScale(this->getContentSize().width / prog->getContentSize().width); //调整到和图标一样大�?
    }

    auto to1 = Sequence::createWithTwoActions(ProgressTo::create(0, 100.f),
                                              ProgressTo::create(time, 0.f));
    prog->runAction(to1);
}
开发者ID:wzit,项目名称:game_new,代码行数:17,代码来源:GameScene.cpp

示例2: progressTimerNodeWithRenderTexture

ProgressTimer* TransitionProgressRadialCW::progressTimerNodeWithRenderTexture(RenderTexture* texture)
{
    Size size = Director::getInstance()->getWinSize();
    
    ProgressTimer* node = ProgressTimer::create(texture->getSprite());
    
    // but it is flipped upside down so we flip the sprite
    node->getSprite()->setFlippedY(true);
    node->setType( ProgressTimer::Type::RADIAL );
    
    //    Return the radial type that we want to use
    node->setReverseDirection(true);
    node->setPercentage(100);
    node->setPosition(Vector2(size.width/2, size.height/2));
    node->setAnchorPoint(Vector2(0.5f,0.5f));
    
    return node;
}
开发者ID:Jthora,项目名称:BeatRecognitionSystem,代码行数:18,代码来源:CCTransitionProgress.cpp

示例3: onSkillStarted

void SkillItem::onSkillStarted()
{
    this->setEnabled(false);
    
    ProgressTo *to1 = ProgressTo::create(getSkillCDTime(), 100);
    ProgressTimer *sprite = ProgressTimer::create(Sprite::create(this->getDisableIcon().c_str()));
    sprite->setType(ProgressTimer::Type::RADIAL);
    
    auto tint = Sequence::create(TintTo::create(getSkillCDTime(), 60, 255, 180),
                                 NULL);

    
    sprite->setPosition(Point(getContentSize().width / 2, getContentSize().height / 2));
    sprite->setBarChangeRate(Point(0, 1));
    addChild(sprite, 0, SKILL_ITEM_CHILD_TAG);
    sprite->runAction(Sequence::create(Spawn::create(to1, tint, NULL),CallFunc::create( CC_CALLBACK_0( SkillItem::onSkillCDFinished, this)) ,NULL) );


}
开发者ID:duongbadu,项目名称:FightGame,代码行数:19,代码来源:SkillItem.cpp

示例4: init

bool skillCd::init()
{
	if (!Layer::init())
		return false;
	Size visibleSize = Director::getInstance()->getVisibleSize();

	ProgressTo *to = ProgressTo::create(3.0f, 100);
	
	Sprite *skill_icon = Sprite::create("icon.png");
	ProgressTimer *skill = ProgressTimer::create(skill_icon);
	skill->setType(kCCProgressTimerTypeRadial);
	skill->setPosition(visibleSize.width / 2, visibleSize.height / 2);
	addChild(skill);

	Sprite *skill_icon_back = skill_icon;
	skill_icon_back->setPosition(visibleSize.width / 2, visibleSize.height / 2);
	skill_icon_back->setOpacity(100);
	addChild(skill_icon_back);
	skill->runAction(to);
	return true;
}
开发者ID:mengjiangtao,项目名称:Cocos2dx,代码行数:21,代码来源:skillCd.cpp

示例5: init


//.........这里部分代码省略.........
    this->addChild(left_btn,1);
    
    auto right_btn = Sprite::create("right.png");
    right_btn->setScale(0.3);
    right_btn->setPosition(Point(250, 125));
    right_btn->setTag(TAG_RIGHT);
    this->addChild(right_btn,1);
    
    auto up_btn = Sprite::create("up.png");
    up_btn->setScale(0.3);
    up_btn->setPosition(Point(175, 200));
    up_btn->setTag(TAG_UP);
    this->addChild(up_btn,1);
    
    auto down_btn = Sprite::create("down.png");
    down_btn->setScale(0.3);
    down_btn->setPosition(Point(175, 50));
    down_btn->setTag(TAG_DOWN);
    this->addChild(down_btn,1);

    auto attack_btn = Sprite::create("attack.png");
    attack_btn->setScale(0.5);
    attack_btn->setPosition(positionForTileCoord(Point(25,16)));
    attack_btn->setTag(ATTACK);
    this->addChild(attack_btn,1);
    
    //hero hp
    Sprite *heroEmHP = Sprite::create("empty.png");
    heroEmHP->setPosition(Point(150, 600));
    heroEmHP->setScale(1.5);
    this->addChild(heroEmHP);
    Sprite* heroFuHP = Sprite::create("full.png");
    ProgressTimer *pBlood = ProgressTimer::create(heroFuHP);
    pBlood->setType(kCCProgressTimerTypeBar);
    pBlood->setMidpoint(Point(0, 0));
    pBlood->setBarChangeRate(Point(1, 0));
    pBlood->setPercentage(100.0f);
    pBlood->setPosition(Point(150, 600));
    pBlood->setScale(1.5);
    this->addChild(pBlood, 1, 6);
    auto hero =Sprite::create("hero.png");
    hero->setPosition(Point(50, 600));
    hero->setScale(0.3);
    this->addChild(hero);
    
    //patrol monster hp
    Sprite *enEmHP = Sprite::create("empty.png");
    enEmHP->setPosition(Point(150, 550));
    enEmHP->setScale(1.5);
    this->addChild(enEmHP,1,7);
    Sprite* enFuHP = Sprite::create("full.png");
    ProgressTimer *enpBlood = ProgressTimer::create(enFuHP);
    enpBlood->setType(kCCProgressTimerTypeBar);
    enpBlood->setMidpoint(Point(0, 0));
    enpBlood->setBarChangeRate(Point(1, 0));
    enpBlood->setPercentage(100.0f);
    enpBlood->setPosition(Point(150, 550));
    enpBlood->setScale(1.5);
    this->addChild(enpBlood, 1,8);
    auto monster = Sprite::create("monster.png");
    monster->setPosition(Point(50,550));
    monster->setScale(0.1);
    monster->setTag(9);
    this->addChild(monster);

    //archer
开发者ID:quanfei,项目名称:ec327-TeamAwesome,代码行数:67,代码来源:HelloWorldScene.cpp


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