Hey guys!
Hope you don't find my recent flood of questions.
Anyways, I was wondering if there is a way to get the "true" global bounds of an sf::Text. What I mean is that when I use the following code, the rectangle doesn't cover the text completely:
playText_.setOrigin(sf::Vector2f(playText_.getLocalBounds().width / 2.0f, playText_.getLocalBounds().height / 2.0f));
selectionRect_.setSize(sf::Vector2f(playText_.getGlobalBounds().width, playText_.getGlobalBounds().height));
selectionRect_.setOrigin(sf::Vector2f(selectionRect_.getSize().x / 2.0f, selectionRect_.getSize().y / 2.0f));
selectionRect_.setPosition(playText_.getPosition());
Do you guys see what I mean? Is there any way around this issue?
EDIT: Now that I look at it, it looks like it is just offset to the top left... However, the origins are at the center so is there any way that can happen?