1
General / Re: Moving sf::Text using setPosition inconsistent amounts
« on: August 06, 2014, 09:53:14 pm »
Thank you for taking the time to get back to me, I really appreciated it. I made the change and it works now.
Now, to understand this correctly, when I am setting the position, it sets the position of the origin? But, getLocalBounds() returns the bounding box of the string text within the sf::Text? The top left coordinates of this local bounds is therefore NOT the origin of the sf::Text? How are these local bounds calculated? Are they changing every time the string of the text changes? I'm sure there is a reason, so why is the top left of the bounding box not at the origin?
Edit: Upon closer look at the documentation I see that there is also a getPosition() function which I assume then get's the global origin. Another solution to the two above would then be: txtMovable.getPosition().y - 10.
Now, to understand this correctly, when I am setting the position, it sets the position of the origin? But, getLocalBounds() returns the bounding box of the string text within the sf::Text? The top left coordinates of this local bounds is therefore NOT the origin of the sf::Text? How are these local bounds calculated? Are they changing every time the string of the text changes? I'm sure there is a reason, so why is the top left of the bounding box not at the origin?
Edit: Upon closer look at the documentation I see that there is also a getPosition() function which I assume then get's the global origin. Another solution to the two above would then be: txtMovable.getPosition().y - 10.