Hi! I'm doing a enhanched version of Pong, and I want to make the ball became a fireball when I press "W" key. Everything is working good, in the costructor of my ball class I load the texture like this:
void Load(std::string filename) {
if(_image.loadFromFile(filename) == false)
{
_filename = "";
_isLoaded = false;
}
else
{
_filename = filename;
_sprite.setTexture(_image);
_isLoaded = true;
}
}
Ok. Now I have to say that my first loading (default) .png texture is 20x20; while the second (fireball one) is 40x40.
When I change the sprite like this (on "W" press event):
Load("fireball.png");
yes, it changes, but the drawing area is the one of 20x20 default sprite, so I see only a piece of my fireball sprite! How can I solve this?
ps. If I load first the biggest texture it draws it well!
Thanks a lot.