Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - groenewoldr

Pages: [1]
1
General / Font problems
« on: September 18, 2015, 02:02:30 am »
sf::RenderWindow window(sf::VideoMode(800, 600), "CALENDAR");

sf::Font font;
if (!font.loadFromFile("arial.ttf"))
    std::cout << "no\n";

sf::Text text1;
text1.setFont(font);
text1.setCharacterSize(30);
text1.setColor(sf::Color::Black);
text1.setStyle(sf::Text::Regular);
text1.setString("ttestst");

while (window.isOpen())
{
    sf::Event event;
    while (window.pollEvent(event))
    {
        switch (event.type){
        case sf::Event::Closed:
            window.close();
        }
    }

    window.clear(sf::Color::White);
    window.draw(text1);
    window.display();
}


I'm pretty sure this should work, but for whatever reason, it doesn't import the font correctly, can anyone help?

Pages: [1]
anything