I am doing bad something or this is so.
Code:
Texture = new sf::Texture();
sf::RectangleShape shape;
shape.setFillColor(sf::Color(0,0,0,150));
shape.setSize(sf::Vector2f(w,h));
shape.setPosition(0,0);
sf::RenderTexture RenderTexture;
RenderTexture.create(w,h);
RenderTexture.draw(shape);
shape.setFillColor(sf::Color(255,0,0,150));
shape.setSize(sf::Vector2f(20,20));
shape.setPosition(0,80);
RenderTexture.draw(shape);
shape.setFillColor(sf::Color(255,255,0,150));
shape.setSize(sf::Vector2f(10,10));
shape.setPosition(0,0);
RenderTexture.draw(shape);
*Texture = RenderTexture.getTexture();
setTexture(*Texture);
setZ(5);
setPosition(sf::Vector2f(10,350));
Image