本文整理汇总了C++中Billboard::SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ Billboard::SetPosition方法的具体用法?C++ Billboard::SetPosition怎么用?C++ Billboard::SetPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Billboard
的用法示例。
在下文中一共展示了Billboard::SetPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: icon_spacing
LabelDecoration::LabelDecoration(BaseEntity* _source, Vector3f _screen_position, float _lifetime)
{
source_ = _source;
assert(source_ != NULL);
source_->AddSubscriber(this);
source_location_ = source_->GetGlobalPosition();
lifetime_ = _lifetime;
full_lifetime_ = _lifetime;
fill_.SetFillColor(GLColor(255, 255, 255));
Section_ptr section = (Section_ptr)_source;
Vector3f screen_position = _screen_position;
Vector3f icon_spacing(25, 0, 0);
if(screen_position.x > Camera::Instance().GetWidth() * 0.1f)
icon_spacing.x *= -1;
bool interesting = false;
std::vector<std::string> tags = GetRelevantTags((Section*)_source);
for(std::vector<std::string>::iterator it = tags.begin(); it != tags.end(); ++it)
{
if(!it->compare("Weapon"))
{
Billboard* bb = new Billboard("WeaponIcon", BillboardType::ScreenSpace);
bb->SetPosition(screen_position);
labels_.push_back(bb);
screen_position += icon_spacing;
interesting = true;
}
if(!it->compare("Beam"))
{
Billboard* bb = new Billboard("BeamIcon", BillboardType::ScreenSpace);
bb->SetPosition(screen_position);
labels_.push_back(bb);
screen_position += icon_spacing;
interesting = true;
}
if(!it->compare("Shield"))
{
Billboard* bb = new Billboard("ShieldIcon", BillboardType::ScreenSpace);
bb->SetPosition(screen_position);
labels_.push_back(bb);
screen_position += icon_spacing;
interesting = true;
}
if(!it->compare("Generator"))
{
Billboard* bb = new Billboard("GeneratorIcon", BillboardType::ScreenSpace);
bb->SetPosition(screen_position);
labels_.push_back(bb);
screen_position += icon_spacing;
interesting = true;
}
if(!it->compare("EnergyStorage"))
{
Billboard* bb = new Billboard("EnergyStorageIcon", BillboardType::ScreenSpace);
bb->SetPosition(screen_position);
labels_.push_back(bb);
screen_position += icon_spacing;
interesting = true;
}
if(!it->compare("Thruster"))
{
Billboard* bb = new Billboard("ThrusterIcon", BillboardType::ScreenSpace);
bb->SetPosition(screen_position);
labels_.push_back(bb);
screen_position += icon_spacing;
interesting = true;
}
if(!it->compare("Core"))
{
Billboard* bb = new Billboard("CoreIcon", BillboardType::ScreenSpace);
bb->SetPosition(screen_position);
labels_.push_back(bb);
screen_position += icon_spacing;
interesting = true;
}
if(!it->compare("Joint"))
{
Billboard* bb = new Billboard("JointIcon", BillboardType::ScreenSpace);
bb->SetPosition(screen_position);
labels_.push_back(bb);
screen_position += icon_spacing;
interesting = true;
}
}
if(!interesting)
lifetime_ = -1;
screen_position_ = screen_position;
}