1
Graphics / Drawing a child class of sf::Sprite
« on: April 28, 2013, 10:31:36 pm »
I programmed a child class of sf::Sprite which overrides the Sprites draw function.
TextBox.h
TextBox.cpp
How can I draw the Sprites content in the function?
TextBox.h
class TextBox : virtual private sf::Sprite
{
sf::Text m_text;
public:
virtual void draw( sf::RenderTarget& target, RenderStates states ) const;
};
{
sf::Text m_text;
public:
virtual void draw( sf::RenderTarget& target, RenderStates states ) const;
};
TextBox.cpp
void TextBox::draw( sf::RenderTarget& target, RenderStates states )const
{
//Here I want to draw the Sprites content
target.draw( this->m_text, states );
};
{
//Here I want to draw the Sprites content
target.draw( this->m_text, states );
};
How can I draw the Sprites content in the function?