Answers for "sfml draw tex"

C++
2

sfml draw tex

sf::Text text;

// select the font
text.setFont(font); // font is a sf::Font

// set the string to display
text.setString("Hello world");

// set the character size
text.setCharacterSize(24); // in pixels, not points!

// set the color
text.setFillColor(sf::Color::Red);

// set the text style
text.setStyle(sf::Text::Bold | sf::Text::Underlined);

...

// inside the main loop, between window.clear() and window.display()
window.draw(text);
Posted by: Guest on March-17-2021
2

sfml draw tex

sf::Font font;
if (!font.loadFromFile("arial.ttf"))
{
    // error...
}
Posted by: Guest on March-17-2021

Browse Popular Code Answers by Language