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

Author Topic: sf::String not working at all  (Read 4205 times)

0 Members and 1 Guest are viewing this topic.

quwackers

  • Newbie
  • *
  • Posts: 2
    • View Profile
sf::String not working at all
« on: August 21, 2015, 12:23:35 pm »
So I have been programming a game with no issues with SFML till now.

My code is

sf::String random;
random.SetText("Hello");

And I get the error, 'class sf::String' has no member named 'SetText' but the documentation for sf::String claims it does, I get the same error if I try to call any of the strings class members or if I try to use the sf::String constructor.


Edit: Incase you are wondering yes I did #include <SFML/System.hpp>
Is this a common error?
« Last Edit: August 21, 2015, 12:25:48 pm by quwackers »

victorlevasseur

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: sf::String not working at all
« Reply #1 on: August 21, 2015, 12:44:31 pm »
Hi,

You're looking at an old doc of SFML 1.6. With SFML 2.x, sf::Text is the class to display text on screen and the method is setString().

SFML 2.3 doc : http://www.sfml-dev.org/documentation/2.3.1/

quwackers

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: sf::String not working at all
« Reply #2 on: August 21, 2015, 12:58:36 pm »
Hi,

You're looking at an old doc of SFML 1.6. With SFML 2.x, sf::Text is the class to display text on screen and the method is setString().

SFML 2.3 doc : http://www.sfml-dev.org/documentation/2.3.1/

Thank you so much, I can't believe I didn't realise that :|

 

anything