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

Author Topic: Transform problem  (Read 1144 times)

0 Members and 1 Guest are viewing this topic.

Sakman

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Transform problem
« on: June 29, 2018, 01:41:22 pm »
I am trying to make two copies of 'lines' where the other one is slightly moved in the X direction. Is there a way to directly change it or do I need to make another entity and use its position to change the transform...?

sf::RenderStates states;

states.transform *= getTransform();
window.draw(lines, states);

sf::CircleShape circle;   //I used circleshape just because idk
circle.setPosition(sf::Vector2f(300, 0));

states.transform *= circle.getTransform(); //how do I do this without another entity
window.draw(lines, states);
 

There must be way to do this so please let me know. I have tried to Google and searched the tutorials so please don't tell me to go look harder.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Transform problem
« Reply #1 on: June 29, 2018, 02:44:14 pm »
See the docs and tutorials about sf::Transform and sf::Transformable.
Laurent Gomila - SFML developer