Ejemplo n.º 1
0
RFile::RFile(const std::string & name, const vec3 & colour, const vec2 & pos, int tagid) : Pawn(name,pos,tagid) {
    hidden = true;
    size = gGourceFileDiameter * 1.05;
    radius = size * 0.5;

    setGraphic(gGourceSettings.file_graphic);

    speed = 5.0;
    nametime = 4.0;
    name_interval = nametime;

    namecol     = vec3(1.0, 1.0, 1.0);
    file_colour = colour;

    last_action    = 0.0f;
    fade_start     = -1.0f;
    expired        = false;
    forced_removal = false;

    shadow = true;

    distance = 0;

    setFilename(name);

    if(!file_selected_font.initialized()) {
        file_selected_font = fontmanager.grab("FreeSans.ttf", 18);
        file_selected_font.dropShadow(true);
        file_selected_font.roundCoordinates(false);
        file_selected_font.setColour(vec4(gGourceSettings.selection_colour, 1.0f));
    }

    if(!file_font.initialized()) {
        file_font = fontmanager.grab("FreeSans.ttf", 14);
        file_font.dropShadow(true);
        file_font.roundCoordinates(false);
        file_font.setColour(vec4(1.0f, 1.0f, 1.0f, 1.0f));
    }

    //namelist = glGenLists(1);
    //label = 0;
    setSelected(false);

    dir = 0;
}
Ejemplo n.º 2
0
void ConfApp::draw() {
    if(!ready || app->isFinished()) return;

    if(background_image != 0) {

        display.mode2D();

        glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glEnable(GL_BLEND);
        glEnable(GL_TEXTURE_2D);

        glBindTexture(GL_TEXTURE_2D, background_image->textureid);
        glColor4f(1.0, 1.0, 1.0, 1.0);
        glBegin(GL_QUADS);
            glTexCoord2f(0.0f, 0.0f);
            glVertex2f(0.0f, 0.0f);

            glTexCoord2f(1.0f, 0.0f);
            glVertex2f(display.width, 0.0f);

            glTexCoord2f(1.0f, 1.0f);
            glVertex2f(display.width, display.height);

            glTexCoord2f(0.0f, 1.0f);
            glVertex2i(0.0f, display.height);
        glEnd();

    }

    try {
        app->draw(scaled_t, scaled_dt);
    } catch(...) {
        finished = true;
        return;
    }

    float elapse_time = 15.0;
    float elapsed_fade = 5.0;

    glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glEnable(GL_BLEND);
    glEnable(GL_TEXTURE_2D);

    glColor4f(colour_title.x, colour_title.y, colour_title.z, 1.0);

    FXFont font = fontmanager.grab("FreeSans.ttf", 22);

    font.dropShadow(true);
    font.alignTop(false);

    font.draw(10.0, display.height - 10.0, title.c_str());

    font.alignRight(true);
    font.alignTop(false);

    font.draw(display.width - 10.0, display.height - 10.0, subtitle.c_str());
}
Ejemplo n.º 3
0
Paddle::Paddle(vec2 pos, vec4 colour, std::string token, FXFont font) {
    this->token = token;

// TODO: fix colouring
//    this->token_colour = token.size() > 0 ? colourHash2(token) : vec3(0.5,0.5,0.5);
    this->token_colour = token.size() > 0 ? colourHash(token) : vec3(0.5,0.5,0.5);

    this->pos = pos;
    this->lastcol = colour;
    this->default_colour = colour;
    this->colour  = lastcol;
    this->width = 10;
    this->height = 50;
    this->target = 0;

    font.alignTop(true);
    font.alignRight(true);
    font.dropShadow(true);

    this->font = font;

    dest_y = -1;
}