Hey guys, im just testing out the sf::Sprite, now at the moment my code uses a simple image manager to load a image, it then sets the sprite of a class, so for example
item.cpp has a public variable sf::Sprite spriteImg;
so i then call item1.spriteImg.setTexture(imgManage.get_image("imgArgh.gif"),
now this is the code I have for its update, which is called when the player presses space
sf::IntRect temp = sprite.getTextureRect();
pos.h = temp.height; //66
pos.w = temp.width; //66
sprite.setTextureRect(temp);
Now this just sets up the correct height and width.
That works all fine and well but, if i then do this for example
item1.spriteImg.setTexture(imgManage.get_image("circle.gif"),
this code then executes
sf::IntRect temp = sprite.getTextureRect();
pos.h = temp.height; //32
pos.w = temp.width; //32
sprite.setTextureRect(temp);
My circle image is set to 66 width and 66 height...
What am I doing wrong? I would try and reset the sf::Sprite but there doesn't seem to be a function.
Cheers