示例#1
0
文件: ui_panel.cpp 项目: lrh/SFGE
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);
}
示例#2
0
文件: Scene.cpp 项目: Salepate/Games
//
//  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]);

}
示例#3
0
文件: HUD.cpp 项目: Salepate/Games
// 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);
    }
}
示例#4
0
文件: Label.cpp 项目: MStr3am/sfui
void    Label::OnPaint(RenderTarget& target, RenderQueue& queue) const
{
    Widget::OnPaint(target, queue);

    queue.SetColor(GetTextColor());
    target.Draw(mCaption);
}
示例#5
0
文件: Text.cpp 项目: EugenT/SFML
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();
	}
示例#7
0
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);
    }
}
示例#8
0
文件: Widget.cpp 项目: MStr3am/sfui
        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);
            }
        }
示例#9
0
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);
}
示例#10
0
文件: Widget.cpp 项目: MStr3am/sfui
 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()));
 }
示例#11
0
void VertexArray::Draw(RenderTarget& target, RenderStates states) const
{
    if (!myVertices.empty())
        target.Draw(&myVertices[0], myVertices.size(), myPrimitiveType, states);
}
示例#12
0
void Projectile::Render(RenderTarget& target) const {
    target.Draw(p);
}
示例#13
0
 void Animation::Draw(RenderTarget& Target) {
     Target.Draw(*this);
 }