Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Problem with positions of sf::RenderTexture  (Read 1996 times)

0 Members and 1 Guest are viewing this topic.

exafi

  • Newbie
  • *
  • Posts: 41
    • View Profile
Problem with positions of sf::RenderTexture
« on: March 27, 2013, 03:48:56 pm »
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