-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
768d88a
commit 4548f2f
Showing
9 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
|
||
#include "endgamescreen.hpp" | ||
|
||
EndGameScreen::EndGameScreen(int score, QWidget *parent) | ||
: QWidget(parent), scoreLabel(new QLabel(this)) { | ||
// Layout vertical pour organiser les widgets | ||
QVBoxLayout *layout = new QVBoxLayout(this); | ||
|
||
// Étiquette de texte pour afficher le score | ||
QLabel *scoreLabel = new QLabel("Score: " + QString::number(score), this); | ||
scoreLabel->setFont(QFont("Arial", 24, QFont::Bold)); // Police en gras et taille 24 | ||
scoreLabel->setAlignment(Qt::AlignCenter); // Centrez le texte | ||
|
||
// Ajouter l'étiquette de score au layout | ||
layout->addWidget(scoreLabel); | ||
|
||
// Définir le layout pour la fenêtre | ||
setLayout(layout); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
|
||
#ifndef SNAKEQT_ENDGAMESCREEN_HPP | ||
#define SNAKEQT_ENDGAMESCREEN_HPP | ||
|
||
#include <QWidget> | ||
#include <QLabel> | ||
#include <QVBoxLayout> | ||
|
||
class EndGameScreen : public QWidget { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit EndGameScreen(int score, QWidget *parent = nullptr); | ||
|
||
private: | ||
QLabel *scoreLabel; | ||
}; | ||
|
||
#endif //SNAKEQT_ENDGAMESCREEN_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters