1
Graphics / Re: How the heck does origin work? Extremely confused.....
« on: February 27, 2019, 08:40:19 pm »If you're setting the origin to the bottom of the smaller rectangle and want both origins to be in the same place (i.e. the bottom of the small one touching the top of the larger one) then both rectangles should have the same position.
I see. So let's say I want the same result, but the starting square has it's origin in the center. How would I go about doing it?
QuoteIs there a way to force apply the transformations immediately?Yes. Bypass the entity's transform with your own transform (sf::Transform). sf::Transform is lower level, it's actually a thin wrapper on top of a 4x4 matrix so you can build whatever you want with it.sf::Transform transform;
transform.translate(x, y); // first translate
transform.rotate(a); // then rotate
// ...
window.draw(entity, transform);
Then, remember that everything based on the entity's transform (local/global bounds for example) won't be right since it will use the entity's transform and not yours.
Thanks. Unfortunately I won't be able to use that method as I need to be able to use the entity's transform.