#include <SFML/Graphics.hpp>
using namespace sf;
using namespace std;
int main()
{
sf::RenderWindow window(sf::VideoMode(400, 200), "SFML text test");
sf::Font font;
sf::Text Ttext;
int Pscore;
std::string score, score2;
std::srand(static_cast<unsigned int>(std::time(NULL)));
if (!font.loadFromFile("sansation.ttf"))
return EXIT_FAILURE;
Ttext.setFont(font);
Ttext.setCharacterSize(30);
Ttext.setPosition(50.f, 20.f);
Ttext.setColor(sf::Color::Black);
Pscore = std::rand() % 6;
score2 = "\nTotal";
score = "Score " + Pscore + score2;
Ttext.setString(score);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear(sf::Color::White);
window.draw(Ttext);
window.display();
}
return 0;
}