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

Author Topic: Cant show text  (Read 567 times)

0 Members and 1 Guest are viewing this topic.

Moonglum

  • Newbie
  • *
  • Posts: 10
    • View Profile
Cant show text
« on: April 25, 2023, 11:10:58 am »
Hi all,
Would appreciate some guidance on fonts please. I have tried to follow guides to put some text on the render window but just get nothing.  My code is:

    sf::Text text;
    sf::Font font;
   
    if (font.loadFromFile("C:\\Windows\\Fonts\\Arial.ttf"))
    {
        cout<< "Font Is Ok";
    }
    else
    {
        cout << "Font is not found";
    }

    text.setString("Message");
    text.setFillColor(sf::Color::White);
    window.draw(text);
    window.display();

Any clues would be appreciated.

Many thanks

Moon.



Moonglum

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Cant show text
« Reply #1 on: April 25, 2023, 11:29:41 am »
Apologies, just spotted the missing font statement.  Cancel this one. Thanks.