void dialogs::show_dialog(std::string face_file, bool top_side, std::string lines[3], bool show_btn=true)
{
    UNUSED(top_side);
    std::string temp_text;
    char temp_char;

    if (lines[0].size() < 1) {
        return;
    }

    timer.pause();

    draw_dialog_bg(show_btn);
    draw_lib.update_screen();
    st_position dialog_pos = graphLib.get_dialog_pos();
    graphLib.place_face(face_file, st_position(dialog_pos.x+16, dialog_pos.y+16));
    draw_lib.update_screen();

    /// @TODO: usar show_config_bg e hide_config_bg da graphLib - modificar para aceitar centered (que é o atual) ou top ou bottom
    for (int i=0; i<3; i++) {
        for (unsigned int j=0; j<lines[i].size(); j++) {
            temp_char = lines[i].at(j);
            temp_text = "";
            temp_text += temp_char;

            graphLib.draw_text(j*9+(dialog_pos.x+52), i*11+(dialog_pos.y+16), temp_text);
            draw_lib.update_screen();
            input.waitTime(15);
        }
    }

    input.wait_keypress();
    timer.unpause();

}
示例#2
0
void draw::show_ingame_warning(std::vector<std::string> message)
{
    graphLib.show_dialog(0, true);
    st_position dialog_pos = graphLib.get_dialog_pos();
    for (unsigned int i=0; i<message.size(); i++) {
        graphLib.draw_text(dialog_pos.x+20, dialog_pos.y+16+(12*i), message[i]);
    }
    input.clean();
    input.wait_keypress();
}
示例#3
0
int main(int argc, char *argv[])
{
    get_filepath();
    fio.read_game(game_data);
    soundManager.init_audio_system();

    if (graphLib.initGraphics() != true) {
        printf("ERROR intializing graphic\n");
        return -1;
    }

    sceneShow show;
    show.show_scene(0);

    input.wait_keypress();


    return 1;
}