本文整理汇总了C++中graphicsLib::erase_menu_item方法的典型用法代码示例。如果您正苦于以下问题:C++ graphicsLib::erase_menu_item方法的具体用法?C++ graphicsLib::erase_menu_item怎么用?C++ graphicsLib::erase_menu_item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graphicsLib
的用法示例。
在下文中一共展示了graphicsLib::erase_menu_item方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute_ingame_menu
bool class_config::execute_ingame_menu()
{
st_position old_pos;
if (input.p1_input[BTN_START] == 1) {
input.clean();
input.waitTime(300);
// leaving menu, removes pause
if (ingame_menu_active == true) {
timer.unpause();
}
ingame_menu_active = !ingame_menu_active;
if (ingame_menu_active) {
timer.pause();
generate_weapons_matrix();
draw_ingame_menu();
} else {
// change player color/weapon
if (ingame_menu_pos.y != 6) {
player_ref->set_weapon(convert_menu_pos_to_weapon_n(ingame_menu_pos));
} else {
// use item
use_tank(ingame_menu_pos.x);
ingame_menu_active = !ingame_menu_active; // keep itself inside the menu
generate_weapons_matrix();
draw_ingame_menu();
}
}
}
if (ingame_menu_active) {
old_pos.x = ingame_menu_pos.x;
old_pos.y = ingame_menu_pos.y;
if (input.p1_input[BTN_UP] == 1) {
move_cursor(0, -1);
} else if (input.p1_input[BTN_DOWN] == 1) {
move_cursor(0, 1);
} else if (input.p1_input[BTN_LEFT] == 1) {
move_cursor(-1, 0);
} else if (input.p1_input[BTN_RIGHT] == 1) {
move_cursor(1, 0);
} else if (input.p1_input[BTN_R] == 1) {
if (gameControl.show_config(game_save.stages[gameControl.currentStage]) == true) { // player picked "leave stage" option
ingame_menu_active = false;
timer.unpause();
return true;
}
draw_ingame_menu();
}
if (old_pos.x != ingame_menu_pos.x || old_pos.y != ingame_menu_pos.y) {
//std::cout << ">> old_pos.y: " << old_pos.y << ", ingame_menu_pos.y: " << ingame_menu_pos.y << std::endl;
if (old_pos.y != 6) {
graphLib.draw_weapon_cursor(old_pos, player_ref->get_weapon_value(convert_menu_pos_to_weapon_n(old_pos)), -1);
graphLib.draw_weapon_icon(convert_menu_pos_to_weapon_n(old_pos), old_pos, false);
} else {
graphLib.erase_menu_item(old_pos.x);
}
if (ingame_menu_pos.y != 6) {
graphLib.draw_weapon_cursor(ingame_menu_pos, player_ref->get_weapon_value(convert_menu_pos_to_weapon_n(ingame_menu_pos)), player_ref->get_number());
graphLib.draw_weapon_icon(convert_menu_pos_to_weapon_n(ingame_menu_pos), ingame_menu_pos, true);
change_player_frame_color();
} else {
graphLib.draw_menu_item(ingame_menu_pos.x);
}
}
input.clean();
input.waitTime(MENU_CHANGE_DELAY);
}
return ingame_menu_active;
}