void Game::displayMainMenu() {
scene->clear();
scene->setSceneRect(0,0,1030,768);
setFixedSize(1030,768);
setBackgroundBrush
(QImage("../Sources/Pictures/Menu/background.png"));
// buttons and properties
playButton
= new Button
(QString("../Sources/Pictures/Menu/start-inactive.png"),
QString("../Sources/Pictures/Menu/start-active.png"));
int bxPos = playButton->boundingRect().width()/8 + 3;
int byPos = 380;
playButton->setPos(bxPos, byPos);
connect(playButton,SIGNAL(clicked()), this, SLOT(start()));
scene->addItem(playButton);
scoreButton
= new Button
(QString("../Sources/Pictures/Menu/scores-inactive.png"),
QString("../Sources/Pictures/Menu/scores-active.png"));
int sxPos = scoreButton->boundingRect().width()/8 + 3;
int syPos = 450;
scoreButton->setPos(sxPos, syPos);
connect(scoreButton,SIGNAL(clicked()), this, SLOT(showScores()));
scene->addItem(scoreButton);
helpButton
= new Button
(QString("../Sources/Pictures/Menu/help-inactive.png"),
QString("../Sources/Pictures/Menu/help-active.png"));
int hxPos = helpButton->boundingRect().width()/8 + 3;
int hyPos = 520;
helpButton->setPos(hxPos, hyPos);
connect(helpButton,SIGNAL(clicked()), this, SLOT(showHelp()));
scene->addItem(helpButton);
quitButton
= new Button
(QString("../Sources/Pictures/Menu/quit-inactive.png"),
QString("../Sources/Pictures/Menu/quit-active.png"));
int qxPos = quitButton->boundingRect().width()/8 + 3;
int qyPos = 610;
quitButton->setPos(qxPos, qyPos);
connect(quitButton,SIGNAL(clicked()), this, SLOT(close()));
scene->addItem(quitButton);
backButton
= new Button
(QString("../Sources/Pictures/Menu/back-inactive.png"),
QString("../Sources/Pictures/Menu/back-active.png"));
int backxPos = scene->width()/2 - 40;
int backyPos = 610;
backButton->setPos(backxPos, backyPos);
connect(backButton,SIGNAL(clicked()), this, SLOT(displayMainMenu()));
scene->addItem(backButton);
parchmentImage
= new QLabel();
QPixmap img
("../Sources/Pictures/Menu/paper.png");
parchmentImage->setPixmap(img);
double x = img.width();
double y = img.height();
parchmentImage->setGeometry(300,250,x,y);
scene->addWidget(parchmentImage);
info = new TextInformation();
info->setPosition(300,270);
scene->addItem(info);
if(backButton->isVisible()) { scene->removeItem(backButton); }
if(info->isVisible()) { scene->removeItem(info); }
info->setProperties(Qt::black,"arial",16,300,270);
parchmentImage->setHidden(true);
playButton->setEnabled(true);
scoreButton->setEnabled(true);
helpButton->setEnabled(true);
quitButton->setEnabled(true);
}