Hi everybody,
I'm just learning SFML and I'm having a trouble to load a picture without background - my current screen is black and I'd like to put sprite at screen (the .png picture i have is transparent) but still shows white background under.
Is there any simple way to make the texture/sprite transparent?
My code:
sf::Texture texture;
sf::Sprite sprite;
if (!texture.loadFromFile("spacetest2.png"))
{
// error...
std::cout << "doesnt work" << std::endl;
}
sprite.setTexture(texture);
window.draw(sprite);
window.display();
I've attached pictures below: