本文整理汇总了C++中SpellItem::setScale方法的典型用法代码示例。如果您正苦于以下问题:C++ SpellItem::setScale方法的具体用法?C++ SpellItem::setScale怎么用?C++ SpellItem::setScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpellItem
的用法示例。
在下文中一共展示了SpellItem::setScale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawSpell
//.........这里部分代码省略.........
// Positioning outer circle
this->setRect(-outerRadius, -outerRadius, outerRadius * 2, outerRadius * 2);
}
else
{
innerRune_ = new RuneItem(spell_, this, runeImages_, runeEngine_);
innerRune_->drawSpell();
connect(innerRune_, SIGNAL(requestRedraw()),
this, SLOT(redraw()));
innerRadius = this->getInnerRadius();
}
// Creating and positioning components and their paths
if (!spell_->getComponents().empty())
{
// Creating
vector<Spell*> spellComponents = spell_->getComponents();
for (Spell* comp : spellComponents)
{
SpellItem* ri = new SpellItem(comp, this, runeImages_, runeEngine_);
ri->drawSpell();
this->components_.push_back(ri);
}
// Positioning components
float componentRadius = this->getBiggestComponentRadius();
componentRadius += innerRadius + _GRAPHICS_SPELLITEM_DISTANCE;
int i = 0;
for (SpellItem* ri : components_)
{
QPointF pos = getPositionOnSpell(i, this->components_.size(), componentRadius, this->pos());
ri->setPos(pos);
this->positionPath(ri, innerRadius);
++i;
}
outerRadius = this->getTotalRadius();
this->setRect(-outerRadius, -outerRadius, outerRadius * 2, outerRadius * 2);
}
else
outerRadius = innerRadius;
// Creating and positioning children and their paths
if (!spell_->getChildren().empty())
{
// Creating
vector<Spell*> spellChildren = spell_->getChildren();
for (Spell* child : spellChildren)
{
// Components
SpellItem* ri = new SpellItem(child, this, runeImages_, runeEngine_);
ri->drawSpell();
this->children_.push_back(ri);
}
// Positioning
float biggestChildRadius = this->getBiggestChildrenRadius();
biggestChildRadius += outerRadius + _GRAPHICS_SPELLITEM_DISTANCE;
int i = 0;
for (SpellItem* ri : children_)
{
QPointF pos = getModifierPositionOnSpell(i,
children_.size(),
biggestChildRadius,
this->pos());
ri->setPos(pos);
this->positionPath(ri, outerRadius);
++i;
}
}
// Creating and positioning modifiers
if (!spell_->getModifiers().empty())
{
// Creating
vector<Spell*> spellModifiers = spell_->getModifiers();
for (Spell* mod : spellModifiers)
{
// Components
SpellItem* ri = new SpellItem(mod, this, runeImages_, runeEngine_);
ri->setScale(0.5f);
ri->drawSpell();
this->modifiers_.push_back(ri);
}
// Positioning
int i = 0;
for (SpellItem* ri : modifiers_)
{
QPointF pos = getPositionOnSpell(i, modifiers_.size(), innerRadius, this->pos());
ri->setPos(pos);
++i;
}
}
if (this->parentItem() == NULL)
colorCenterPart(true);
}