Beispiel #1
0
//Renders a text with a certain font on the surface to draw
bool Surface::RenderText(Font font,std::string text)
{
	Free();//Free surface if already taken
	_surface=TTF_RenderText_Solid( font, text.c_str(), font.GetColor() );//Render the Text
	if (_surface==0)
	{		
		Error error(Caption,"The following text could not be rendered: "+text);
		return false;
	}
	return true;
};
QColor UIButtonMetadata::GetFontColorForState(UIControl::eControlState state) const
{
    UIStaticText* referenceButtonText = GetActiveUIButton()->GetStateTextControl(state);
    if (referenceButtonText)
    {
        Font* referenceFont = referenceButtonText->GetFont();
        if (referenceFont)
        {
            return DAVAColorToQTColor(referenceFont->GetColor());
        }
    }
    
    return QColor();
}
QColor UIStaticTextMetadata::GetFontColor() const
{
    if (!VerifyActiveParamID())
    {
        return QColor();
    }

    Font* font = GetActiveStaticText()->GetFont();
    if (font)
    {
        return DAVAColorToQTColor(font->GetColor());
    }
    
    return QColor();
}