Пример #1
0
void Game::showMainMenu(){
    scene->clear();
    pocetHracu = 0;
    velikost = 0;
    running = false;
    hrac_posunul = false;
    menu = false;
    Button *play_btn = new Button(QString("Nova hra"));
    int x = scene->width()/2 - play_btn->boundingRect().width()/2;
    int y = 250;
    play_btn->setPos(x, y);
    connect(play_btn, SIGNAL(clicked()), this, SLOT(showNewGameMenu()));
    scene->addItem(play_btn);

    Button *exit_btn = new Button(QString("Konec"));
    x = scene->width()/2 - exit_btn->boundingRect().width()/2;
    y = 500;
    exit_btn->setPos(x, y);
    connect(exit_btn, SIGNAL(clicked()), this, SLOT(close()));
    scene->addItem(exit_btn);
}
Пример #2
0
void GlobalUISession::preGame()
{
   // offer user a choice of game types to play
   showNewGameMenu();
}