Yes this has been discussed before, but from the hours I've spent searching I've never seen it solved. Basically, I'm trying to position a text object directly in the center of the screen, but it appears to be off by several pixels on both axels. Here is the basic code:
sf::Text text;
text.setString("sf text test");
//set origin to physical center of text
text.setOrigin(text.getGlobalBounds().left + (text.getGlobalBounds().width / 2), text.getGlobalBounds().top + (text.getGlobalBounds().height / 2));
//screen is 500 * 500, so this is the center of screen
text.setPosition(250, 250);
Yet the linked image is what happens on screen. Adding 20 pixels on the x value and 4 pixels on the y value seems to account for this shift perfectly. I've concluded that this is because there is a hidden, much larger bounding box around the text that is the result of getGlobalBounds(), so how do I account for this hidden variable?