Hello again,
I have replicated my problem below.
I have tried using both getLocalBounds and getGlobalBounds to no avail.
As you can see the stray pixel appears above the G in Game Over. (Screen shot attached.)
If I remove setOrigin line the stray pixel is removed.
I understand getGlobalBounds is using a rectangle and my text is well text.
If this is the problem can you suggest what method I should be using to find the centre of my Text?
Many thanks in advance.
int main()
{
//Game::Start();
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
sf::Font font;
if (!font.loadFromFile("images/Arial.ttf"))
return EXIT_FAILURE;
sf::Text Text ( "Game Over", font, 60);
//Text.setOrigin( Text.getLocalBounds().width /2 , Text.getLocalBounds().height /2 );
Text.setOrigin( (Text.getGlobalBounds().width /2) , (Text.getGlobalBounds().height /2 ));
Text.setPosition(400,300);
while (window.isOpen())
{
window.draw(Text);
window.display();
}
return 0;
}
[attachment deleted by admin]