SFML community forums

Help => Graphics => Topic started by: orella on April 24, 2017, 10:23:34 am

Title: Changing RenderTexture color
Post by: orella on April 24, 2017, 10:23:34 am
Is possible to change the color of a RenderTexture without changing the colors of the sprites on the texture?

RenderTexture white:

(http://i63.tinypic.com/2qsyxz7.jpg)

RenderTexture green:

(http://i66.tinypic.com/suzep0.jpg)

Title: Re: Changing RenderTexture color
Post by: orella on April 24, 2017, 10:34:47 am
NVM i found how to do that XDD
Title: Re: Changing RenderTexture color
Post by: Hapax on April 24, 2017, 12:12:35 pm
renderTexture.clear(sf::Color::Green);
renderTexture.draw(sprite);
renderTexture.display();
Something like that by any chance? :)
Title: Re: Changing RenderTexture color
Post by: Laurent on April 24, 2017, 12:14:01 pm
That only changes the background, not the whole thing. One solution is to set the color of the sprite that displays the content of the render-texture.
Title: Re: Changing RenderTexture color
Post by: Hapax on April 24, 2017, 12:15:59 pm
Is possible to change the color of a RenderTexture without changing the colors of the sprites on the texture?
Did I maybe misunderstand this sentence?
Title: Re: Changing RenderTexture color
Post by: Laurent on April 24, 2017, 12:47:14 pm
Quote
Did I maybe misunderstand this sentence?
Ah, maybe it's me. I focused on the images, thinking they were showing the desired result.

Anyway, the problem is solved so let's stop making this thread longer than necessary :)