void UIPanel::Render( RenderTarget& target ) const { if (!visibled_) return; if (!enabled_ && hasDisabledAnim_) target.Draw(anims_[DISABLED_ANIM_]); else if (hasNormalAnim_) target.Draw(anims_[NORMAL_ANIM_]); __super::Render(target); }
// // void Render(RenderTarget& target) const; // inherit: sf::Drawable // draw function void Scene::Render(RenderTarget& target) const { unsigned int i; for(i = 0; i < _sky.size(); ++i) target.Draw(*_sky[i]); for(i = 0; i < _background.size(); ++i) target.Draw(*_background[i]); for(i = 0; i < _ground.size(); ++i) target.Draw(*_ground[i]); for(i = 0; i < _grass.size(); ++i) target.Draw(*_grass[i]); }
// Drawer void HUD::Render(RenderTarget &target) const { HUD_Element * e; unsigned int i; for(i = 0; i < _elementsBG.size(); ++i) { e = static_cast<HUD_Element*>(_elementsBG[i]); target.Draw(*e->_sprite); } for(i = 0; i < _elementsFG.size(); ++i) { e = static_cast<HUD_Element*>(_elementsFG[i]); target.Draw(*e->_sprite); } }
void Label::OnPaint(RenderTarget& target, RenderQueue& queue) const { Widget::OnPaint(target, queue); queue.SetColor(GetTextColor()); target.Draw(mCaption); }
void Text::Draw(RenderTarget& target, RenderStates states) const { assert(myFont != NULL); states.Transform *= GetTransform(); states.BlendMode = BlendAlpha; // alpha blending is mandatory for proper text rendering states.Texture = &myFont->GetTexture(myCharacterSize); target.Draw(myVertices, states); }
//-------------------------------------------------------------------------- void PostProcessor::Draw( const Texture2D& _colorTex, float _toneExposure, const RenderTarget& _renderTarget) { glUseProgram(toneMapping.program.id); glProgramUniform1f(toneMapping.program.id, toneMapping.exposureVar, _toneExposure); _colorTex.Bind(toneMapping.colorTexUnit); _renderTarget.Draw(); }
void Shape::Draw(RenderTarget& target, RenderStates states) const { states.Transform *= GetTransform(); // Render the inside if (myFillColor.a > 0) { states.Texture = myTexture; target.Draw(myVertices, states); } // Render the outline if ((myOutlineColor.a > 0) && (myOutlineThickness > 0)) { states.Texture = NULL; target.Draw(myOutlineVertices, states); } }
void Widget::RenderChildren(RenderTarget& target, RenderQueue& queue) const { if (!mVisible) return; for (Widgets::const_iterator it = mChildren.begin(); it != mChildren.end(); ++it) { Widget* widg = *it; if (widg->IsVisible()) target.Draw(*widg); } }
void PlayerHUD::renderSingleSpell(RenderTarget& targ, Spell* spell, float x, float y) const { const sf::Vector2f& spellSize = spell->getThumbnail()->GetSize(); const int spellHalfW = spellSize.x / 2; const int spellHalfH = spellSize.y / 2; float cooldown = spell->getTimeSinceLastCast() / spell->getCooldown(); Sprite* sp = (cooldown >= 1) ? spell->getThumbnail() : spell->getDisabledThumbnail(); sp->SetPosition(x, y); targ.Draw(*sp); if(cooldown < 1.0f) renderCooldownTimer(x + spellHalfW, y + spellHalfH, 1-cooldown); }
void Widget::OnPaint(RenderTarget& target, RenderQueue& queue) const { queue.SetColor(GetColor()); target.Draw(Shape::Rectangle(0, 0, mSize.x, mSize.y, GetColor(), 1.f, GetBorderColor())); }
void VertexArray::Draw(RenderTarget& target, RenderStates states) const { if (!myVertices.empty()) target.Draw(&myVertices[0], myVertices.size(), myPrimitiveType, states); }
void Projectile::Render(RenderTarget& target) const { target.Draw(p); }
void Animation::Draw(RenderTarget& Target) { Target.Draw(*this); }