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

Author Topic: sf::Text Background Color  (Read 5353 times)

0 Members and 1 Guest are viewing this topic.

escher

  • Newbie
  • *
  • Posts: 8
    • View Profile
sf::Text Background Color
« on: April 20, 2012, 04:13:32 am »
Is there any way to set a background color for an sf::Text object? I can't seem to find one in the documentation, but I may just be blind. If there's not, any recommendations on how to best fake it out? I'm tinkering with a pretty-console roguelike (see Brogue for an example), and being able to set background colors on a string/character basis is sort of important.

I recognize that I could use a sprite sheet with the characters, but that just feels kludgey, especially when scaling comes in to play. I trust the font system to handle resizing much better than naive resizing of a sprite.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: sf::Text Background Color
« Reply #1 on: April 20, 2012, 07:47:16 am »
sf::Text don't have a background color. At all. It only renders the characters. What you can do is put a rectangular shape under the text.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

escher

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: sf::Text Background Color
« Reply #2 on: April 20, 2012, 12:21:04 pm »
sf::Text don't have a background color. At all. It only renders the characters. What you can do is put a rectangular shape under the text.

That's rather unfortunate. I can think of a lot of scenarios where a background color would be desirable, and it seems like a pretty common option in many other libraries.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sf::Text Background Color
« Reply #3 on: April 20, 2012, 12:58:32 pm »
Since you made a feature request, I have to lock this topic so that the discussion is not duplicated.

http://en.sfml-dev.org/forums/index.php?topic=7653.0
Laurent Gomila - SFML developer