本文整理汇总了C++中ProgressTimer::setAnchorPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgressTimer::setAnchorPoint方法的具体用法?C++ ProgressTimer::setAnchorPoint怎么用?C++ ProgressTimer::setAnchorPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgressTimer
的用法示例。
在下文中一共展示了ProgressTimer::setAnchorPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}