label and background color
« on: 29 October 2015, 18:30:29 »
Hi (again)

well now i face something different. My label has a background color. 

pLabel->getRenderer()->setBackgroundColor(sf::Color(150, 150, 150, 255));

When the label has text to print the background color is visible. When the text is null the background color disappears! 


*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: label and background color
« Reply #1 on: 29 October 2015, 18:32:01 »
Did you give the label a size? If you don't call setSize it will auto-size to be as large as the text, if there is no text then there will be no label.

Re: label and background color
« Reply #2 on: 29 October 2015, 18:45:07 »
I have set size and in advance i have set autosize to false.




*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: label and background color
« Reply #3 on: 29 October 2015, 19:04:22 »
This was caused by an optimization that was made before label supported a background color. The draw function literally started with this:
if (m_text.getString().isEmpty())
    return;

Fixed on github.