I'm trying to make a simple starter menu for an application with two buttons, new and load. The way I figured I'd do it is have two rectangles with text on top. After running I noticed an odd issue that I can't figure out. One piece of text seems to be blurry while the other is crisp and clean. They are both using the same font, size, etc so I'm not sure why one acts differently then the other. Here's an image of it
https://i.imgur.com/CGLuoyO.png and here's the code being used (sorry for the mess I'm just messing around with it atm)
sf::RenderWindow InputWindow(sf::VideoMode(INPUT_W, INPUT_H), "Main Menu");
InputWindow.clear(sf::Color::Black);
sf::Font font;
if (!font.loadFromFile("times.ttf"))
{
std::cout << "Font not loaded!";
}
int button_width = 100, button_height = 50;
sf::RectangleShape NewButton(sf::Vector2f(button_width,button_height));
NewButton.setPosition(sf::Vector2f((INPUT_W / 2)-button_width/2, (INPUT_H / 3 * 1) - button_height/2));
NewButton.setFillColor(sf::Color::White);
sf::RectangleShape LoadButton(sf::Vector2f(100, 50));
LoadButton.setPosition(sf::Vector2f((INPUT_W / 2) - button_width/2, (INPUT_H / 3 * 2) - button_height/2));
LoadButton.setFillColor(sf::Color::White);
sf::Text newText ("New Map",font,20);
sf::Text loadText("Load Map", font, 20);
newText.setPosition(sf::Vector2f((INPUT_W / 2) - newText.getLocalBounds().width /2, (INPUT_H / 3 * 1)- newText.getLocalBounds().height /2));
newText.setFillColor(sf::Color::Black);
loadText.setPosition(sf::Vector2f((INPUT_W / 2) - loadText.getLocalBounds().width /2, (INPUT_H / 3 * 2) - loadText.getLocalBounds().height /2));
loadText.setFillColor(sf::Color::Black);
InputWindow.draw(NewButton);
InputWindow.draw(newText);
InputWindow.draw(LoadButton);
InputWindow.draw(loadText);
InputWindow.display();
On a side note anyone have a better method for centering text?