SFML community forums

Help => General => Topic started by: Kerachi on November 23, 2017, 09:47:36 pm

Title: text.setColor declared deprecated
Post by: Kerachi on November 23, 2017, 09:47:36 pm
Hi everyone!

It worked perfectly in CodeBlocks, but I keep getting this error in Visual Studio:
(http://www.kepfeltoltes.eu/images/hdd1/2017/11/23/519error.png)

Any idea what am I doing wrong?
Title: Re: text.setColor declared deprecated
Post by: eXpl0it3r on November 23, 2017, 10:17:14 pm
The error message is tell you exactly what's going on. ;)

setColor has been deprecated, meaning it was replaced by something else.
Quickly checking the documentation (https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1Text.php#ab7bb3babac5a6da1802b2c3e1a3e6dcc) will unveil that we now have setFillColor as replacement.

If you still want to use the old setColor function, you'll have to adjust your project configuration to not threat deprecations as error.
Title: Re: text.setColor declared deprecated
Post by: Kerachi on November 24, 2017, 08:59:20 am
ehhh

I see, thanks.
Title: Re: text.setColor declared deprecated
Post by: NGM88 on November 24, 2017, 07:13:04 pm
You can
#define SFML_NO_DEPRECATED_WARNINGS
to use deprecated stuff
Title: Re: text.setColor declared deprecated
Post by: Kerachi on November 24, 2017, 09:11:49 pm
I do rather use sf::Text::setFillColor(), but thanks, it's good to know, how can I use deprecated stuff  :)