#include#include int main() { sf::RenderWindow window(sf::VideoMode(640, 480), "Font Draw Example"); fd::Text text("Hello, world!", "arial.ttf", 24); text.setPosition(10, 10); text.setColor(sf::Color::Red); while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) { window.close(); } } window.clear(); window.draw(text); window.display(); } }
#includeThese examples use the Font draw library, which is not a standard C++ library. It seems to be a custom library created by the FD group.#include int main() { sf::RenderWindow window(sf::VideoMode(640, 480), "Font Draw Example"); fd::Text text("This is a {b}bold{/b} and\n{c=FF0000}red{/c} text with size {s=32}32{/s}.", "arial.ttf", 24); text.setPosition(10, 10); while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) { window.close(); } } window.clear(); window.draw(text); window.display(); } }