226
Graphics / Problem with image loading!
« on: September 04, 2007, 06:32:58 pm »
I really think that the best to do is to have different paddles on the image, and with the subRect sprite method, you can easily change the sprite displayed on the screen :
with this, you have only one image, and only one psrite, no ?
Code: [Select]
sfImage image("mypaddles.bmp");
sfSprite paddle;
paddle.SetImage (image);
//using the first paddle
// from (0,0) to (50,50)
paddle.SetSubRect(sfIntRect(0,0,50,50));
...
//Later in game, use the second paddle
// from (50,0) to (150,50) (same height, but larger)
paddle.SetSubRect(sfIntRect(50,0,150,50));
with this, you have only one image, and only one psrite, no ?
