sfml draw tex

Solutions on MaxInterview for sfml draw tex by the best coders in the world

showing results for - "sfml draw tex"
Lya
19 Feb 2019
1sf::Text text;
2
3// select the font
4text.setFont(font); // font is a sf::Font
5
6// set the string to display
7text.setString("Hello world");
8
9// set the character size
10text.setCharacterSize(24); // in pixels, not points!
11
12// set the color
13text.setFillColor(sf::Color::Red);
14
15// set the text style
16text.setStyle(sf::Text::Bold | sf::Text::Underlined);
17
18...
19
20// inside the main loop, between window.clear() and window.display()
21window.draw(text);
22
Izia
22 Oct 2019
1sf::Font font;
2if (!font.loadFromFile("arial.ttf"))
3{
4    // error...
5}
6