Hi,
I really want to know how to check for the Style of Text's.
This is not working:
if(sf_text.getStyle() == sf::Text::Bold)
I wanted to switch between
bold,
italic and
underlined but I think there is a better way to do that than I do.
I am doing it like this:
//****Input was b, to switch Bold on or of****//
if(/*sf_text.getStyle() == sf::Text::Bold*/) //Bold -> change to regular
{
sf_text.setStyle(sf::Text::Regular);
}
else if(/*sf_text.getStyle() == sf::Text::Bold | sf::Text::Italic*/) //Bold & italic -> only italic
{
sf_text.setStyle(sf::Text::Italic);
}
else if(/*sf_text.getStyle() == sf::Text::Bold | sf::Text::Underlined*/) //Bold & underlined-> only underlined
{
sf_text.setStyle(sf::Text::Underlined);
}
//Bold, italic & underlined -> only underlined and italic
else if(/*sf_text.getStyle() == sf::Text::Bold | sf::Text::Italic | sf::Text::Underlined*/)
{
sf_text.setStyle(sf::Text::Italic | sf::Text::Underlined);
}
As you can see this can't be the best way, what is the best way?
Sry for my bad english.