Hi guys! New user here.
Is there a way to update a texture with images with transparent background?
I've tried texture.update() but it literally copies the whole image into the texture including the transparent pixels. This results in the texture having holes in it. Is that intended? If so, is there no way to a create a new image using images with transparent backgrounds in SFML?
sf::Texture texture;
if (!texture.loadFromFile("backgroundimage.png"))
return EXIT_FAILURE;
sf::Image item;
if (!item.loadFromFile("imagewithtransparentbackground.png"))
return EXIT_FAILURE;
texture.update(item,50,50);
sf::Sprite sprite (texture);
~Edit: I just found a way around it using RenderTexture. It seems transparency only works when drawing? I'm still curious if the above code should work. With RenderTexture I'm having to pass texture to sprite to rendertexture and back to sprite to get the result I want.