SFML community forums

Help => System => Topic started by: quwackers on August 21, 2015, 12:23:35 pm

Title: sf::String not working at all
Post by: quwackers 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?
Title: Re: sf::String not working at all
Post by: victorlevasseur 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/
Title: Re: sf::String not working at all
Post by: quwackers 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 :|