SFML community forums

Help => Graphics => Topic started by: Gauzr on June 05, 2015, 11:11:27 pm

Title: Compare the Y coordinate in a loop
Post by: Gauzr on June 05, 2015, 11:11:27 pm
Hi, I'm a bit uncertain on how I can get the value of a shape's Y coordinate. I tried doing
float shapeycord = shape1.getPosition.y();
if (shapeycoord == -100)
...
However I know this is not right. Does it have to be pointer to FloatRect? Im a bit confused. What I would like to do is get the .y coord of the shape, and if it contains a certain y coordinate, then it will do something.
Title: Re: Compare the Y coordinate in a loop
Post by: Gauzr on June 05, 2015, 11:35:19 pm
Ah, I believe I fixed it by changing it to shape.getPosition().y, that is I think.
Title: Re: Compare the Y coordinate in a loop
Post by: Hapax on June 05, 2015, 11:55:50 pm
shape.getPosition().y
looks much better  :)