SFML community forums

Help => Graphics => Topic started by: zivkovic on May 31, 2012, 09:43:00 pm

Title: White sprite
Post by: zivkovic on May 31, 2012, 09:43:00 pm
Okay, im having this problem and don't quite know how to fix it.

I have a class that implements/extends the class Sprite.
class Background: public Sprite {
public:
        Background();
        virtual ~Background();
};
Then in the constructor I got it like this:
Background::Background() {
        Image image;
        image.LoadFromFile("Sprites/BitRed.png");
        SetImage(image);
}

And I'm using it like this:

Background sprite;
        win.draw(sprite);

But I'm always getting white box in the same size as the image without anything else.
Can someone please tell me how to  fix it or give me an example usage.

Thanks!
Title: Re: White sprite
Post by: Lo-X on May 31, 2012, 09:59:18 pm
Posted today : http://en.sfml-dev.org/forums/index.php?topic=8112.0 (you haven't searched  ::) )
I advise you to read more about C++ to avoid that kind of mistakes ;D
Title: Re: White sprite
Post by: zivkovic on June 01, 2012, 08:48:42 am
Solved the problem THANKS!