SFML community forums

Help => General => Topic started by: Sakman on June 29, 2018, 01:41:22 pm

Title: Transform problem
Post by: Sakman 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.
Title: Re: Transform problem
Post by: Laurent on June 29, 2018, 02:44:14 pm
See the docs and tutorials about sf::Transform and sf::Transformable.