Last active
August 29, 2015 14:05
-
-
Save eXpl0it3r/9b692f286494b8f261fe to your computer and use it in GitHub Desktop.
SFML/feature/strikethrough
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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