当前位置: 首页>>代码示例>>C++>>正文


C++ timerLib::pause方法代码示例

本文整理汇总了C++中timerLib::pause方法的典型用法代码示例。如果您正苦于以下问题:C++ timerLib::pause方法的具体用法?C++ timerLib::pause怎么用?C++ timerLib::pause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在timerLib的用法示例。


在下文中一共展示了timerLib::pause方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: show_timed_dialog

void dialogs::show_timed_dialog(std::string face_file, bool is_left, std::string lines[], short delay, bool show_btn=true)
{
    UNUSED(is_left);
    std::string temp_text;
    char temp_char;

    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);
            //graphLib.draw_text(j*9+53, i*11+9, "A");
            draw_lib.update_screen();
            input.waitTime(15);
        }
    }
    input.waitTime(delay);
    timer.unpause();
}
开发者ID:DavidKnight247,项目名称:Rockbot-GCW0-port,代码行数:30,代码来源:dialogs.cpp

示例2: show_leave_game_dialog

bool dialogs::show_leave_game_dialog() const
{
    bool res = false;
    bool repeat_menu = true;
    int picked_n = -1;

    timer.pause();

    std::cout << ">>>>>>> show_leave_game_dialog::START" << std::endl;

    graphicsLib_gSurface bgCopy;
    graphLib.initSurface(st_size(RES_W, RES_H), &bgCopy);
    graphLib.copyArea(st_position(0, 0), &graphLib.gameScreen, &bgCopy);

    graphLib.show_dialog(0, false);
    st_position dialog_pos = graphLib.get_dialog_pos();
    graphLib.draw_text(dialog_pos.x+30, dialog_pos.y+16, "QUIT GAME?");
    std::vector<std::string> item_list;
    item_list.push_back("YES");
    item_list.push_back("NO");
    option_picker main_picker(false, st_position(dialog_pos.x+40, dialog_pos.y+16+11), item_list, false);
    draw_lib.update_screen();
    while (repeat_menu == true) {
        picked_n = main_picker.pick();
        std::cout << "picked_n: " << picked_n << std::endl;
        if (picked_n == 0) {
            res = true;
            repeat_menu = false;
        } else if (picked_n == 1) {
            res = false;
            repeat_menu = false;
        } else {
            main_picker.draw();
        }
    }
    input.clean();
    input.waitTime(200);
    graphLib.copyArea(st_position(0, 0), &bgCopy, &graphLib.gameScreen);
    draw_lib.update_screen();
    timer.unpause();

    std::cout << ">>>>>>> show_leave_game_dialog::END" << std::endl;

    return res;
}
开发者ID:farleyknight,项目名称:rockbot,代码行数:45,代码来源:dialogs.cpp


注:本文中的timerLib::pause方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。