Beispiel #1
0
    void    InfoBox::draw(sf::RenderWindow& rw)
    {
        glColor3f(0.6, 0.6, 0.6);
        drawRectangle(start_, end_, true);

        static sf::String tx;
        tx.SetText("Status");
        tx.SetFont(sf::Font::GetDefaultFont());
        tx.SetStyle(sf::String::Bold);
        tx.SetPosition(start_[0] + 20, start_[1] + 20);
        tx.SetSize(16);
        rw.Draw(tx);
    }
Beispiel #2
0
void Param::set_police(sf::String &destination, const char *ligne)
{
    int i = 0;
    long unsigned int style = sf::String::Regular;
    while(ligne[i] != '\0')
    {
        switch(ligne[i])
        {
            case 's' :
            case 'u' :
            case 'S' :
            case 'U' :
                style |=  sf::String::Underlined;
            break;
            case 'b' :
            case 'g' :
            case 'B' :
            case 'G' :
                style |=  sf::String::Bold;
            break;
            case 'n' :
            case 'd' :
            case 'N' :
            case 'D' :
                style = sf::String::Regular;
            break;
            case 'i' :
            case 'I' :
                style |=  sf::String::Italic;
            break;
        }
        i++;
        while(ligne[i] != '|' && ligne[i] != '\0')
        {
            i++;
        }
        if(ligne[i] != '\0')
        {
            i++;
            if(ligne[i] == ' ')
                i++;
        }
    }
    destination.SetStyle(style);
}