本文整理汇总了C++中graphicsLib::show_dialog方法的典型用法代码示例。如果您正苦于以下问题:C++ graphicsLib::show_dialog方法的具体用法?C++ graphicsLib::show_dialog怎么用?C++ graphicsLib::show_dialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graphicsLib
的用法示例。
在下文中一共展示了graphicsLib::show_dialog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw_dialog_bg
void dialogs::draw_dialog_bg(bool show_btn=true)
{
if (is_showing_dialog_bg == true) {
return;
}
graphLib.show_dialog(1, show_btn);
}
示例2: show_ingame_warning
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: 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;
}