SFML community forums
Help => Graphics => Topic started by: caelestis on January 13, 2010, 03:18:03 am
-
How would I overload the draw function for RenderWindow so that I can update the objects properties before I draw it? I'm a little noobish sorry.
-
You could update the properties of the Sprite before calling Draw?
-
You cannot overload a function in a foreign class without intruding it (and the surrounding namespace), which you shouldn't do.
Just write a free function that performs the required actions.
void UpdateAndDraw(sf::RenderWindow& Window, sf::Sprite& Sprite)
{
// update Sprite here
Window.Draw(Sprite);
}