Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: White sprite  (Read 1656 times)

0 Members and 1 Guest are viewing this topic.

zivkovic

  • Newbie
  • *
  • Posts: 11
    • View Profile
White sprite
« 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!
« Last Edit: May 31, 2012, 09:46:29 pm by Laurent »

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: White sprite
« Reply #1 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

zivkovic

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: White sprite
« Reply #2 on: June 01, 2012, 08:48:42 am »
Solved the problem THANKS!