SFML community forums
Help => Graphics => Topic started by: TheGameDev on August 04, 2014, 08:48:43 pm
-
Hello,
I'm trying to get the points of a RectangleShape, while he is moving. But it seams that the getPoint() method gives me only the local coordinates of the points.
Do you know how I can get that ?
Thank in advance.
-
RectangleShape.getGlobalBounds();
-
Hum, can I get more informations please, becasue I dont know how I could get points from getGlobalBounds....
-
The global bounds give you the axis-aligned rectangle which is possibly larger than the shape's drawn rectangle. So zsbzsb's suggestion might not be what you want.
You have to transform each point; have a look at the documentation of the sf::Transform class and sf::RectangleShape::getTransform().
-
Okay thank you, what I've done (for pepole who want to know):
rect.getTransform().transformPoint(rect.getPoint(0));
See ya :)
-
By the way, please post in the "Help" section next time, not in "General Discussions" ;)
-
So zsbzsb's suggestion might not be what you want.
Reading the original question made it seem as if the OP wanted to just get the bounds of the shape, not the actual points. :P
-
Reading the original question made it seem as if the OP wanted to just get the bounds of the shape, not the actual points.
Really? :P
I'm trying to get the points of a RectangleShape, while he is moving. But it seams that the getPoint() method gives me only the local coordinates of the points.