Ejemplo n.º 1
0
void    Label::LoadStyle(const std::string& nameStyle)
{
    ResourceManager* rm = ResourceManager::Get();
    StyleProperties& properties = rm->GetStyle(nameStyle);

    SetTextColor(rm->GetColorValue(properties["textColor"], GetTextColor()));

    Font* newFont = rm->GetFont(properties["font"], GetTextSize());
    if (newFont)
    {
        SetFont(*newFont);
    }

    if (properties["textSize"] != "")
    {
        mCaption.SetSize(rm->GetValue(properties["textSize"], GetTextSize()));

        const Vector2f& strSize = mCaption.GetRect().GetSize();

        if (properties["width"] == "")
            SetWidth(strSize.x);
        if (properties["height"] == "")
            SetHeight(strSize.y);
    }

    Widget::LoadStyle(nameStyle);
}