I know, that there are libraries on the wiki, but i just wanted to go trough the process myself, of using spritesheets.
The spritesheet is 32x16 and i created an Rect, that holds the positions of the sprites in the sprite sheet.
I know that giving an rectangle as coordinates doesn't work, but how do i get around this?
sf::Image Image;
if (!Image.LoadFromFile("spritesheet.png"))
return EXIT_FAILURE;
sf::Shape Rect[ 2 ];
Rect[0].SetPointPosition(1, 0, 0);
Rect[0].SetPointPosition(2, 16, 0);
Rect[0].SetPointPosition(3, 16, 16);
Rect[0].SetPointPosition(4, 0, 16);
Rect[1].SetPointPosition(1, 16, 0);
Rect[1].SetPointPosition(2, 32, 0);
Rect[1].SetPointPosition(3, 32, 16);
Rect[1].SetPointPosition(4, 16, 16);
sf::Sprite Sprite(Image);
Sprite.SetSubRect(Rect[0]);