Skip to content

Instantly share code, notes, and snippets.

@eXpl0it3r
Last active August 29, 2015 14:05
Show Gist options
  • Save eXpl0it3r/9b692f286494b8f261fe to your computer and use it in GitHub Desktop.
Save eXpl0it3r/9b692f286494b8f261fe to your computer and use it in GitHub Desktop.
SFML/feature/strikethrough
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML works!");
window.setFramerateLimit(60);
sf::Font font;
font.loadFromFile("DroidSans.ttf");
sf::Text text;
text.setFont(font);
text.setString("abcdefghijklmnopqrstuvwxyz\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n1234567890\nöäüéàèÉÀÈÖÄÜ\n¦@#°§¬|¢?`^!$£-.,;:_<>\\");
text.setStyle(sf::Text::StrikeThrough | sf::Text::Italic | sf::Text::Bold);
text.setPosition({20.f, 40.f});
text.setCharacterSize(40);
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();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment