Push bouton pour retourner au menu principal. Makeover des anciens boutons.

This commit is contained in:
mduval76 2023-12-01 20:26:52 -05:00
parent 98390c878f
commit 3842ca3485
12 changed files with 20 additions and 0 deletions

View File

@ -147,6 +147,7 @@ void Engine::LoadResource() {
LoadTexture(m_textureSoloMultiMenu, TEXTURE_PATH "single_multi.png", false);
LoadTexture(m_textureTitle, TEXTURE_PATH "title.png", false);
LoadTexture(m_textureOptions, TEXTURE_PATH "Buttons/options.png", false);
LoadTexture(m_textureRetour, TEXTURE_PATH "Buttons/retour.png", false);
LoadTexture(m_textureVolume, TEXTURE_PATH "Buttons/volume.png", false);
LoadTexture(m_textureMusique, TEXTURE_PATH "Buttons/musique.png", false);
LoadTexture(m_textureGraphiques, TEXTURE_PATH "Buttons/graphiques.png", false);
@ -538,6 +539,7 @@ void Engine::DrawOption()
glTexCoord2f(0, 1); glVertex2i(centerX - Width() * 0.375, centerY - Height() * 0.05);
glEnd();
// Séparateur
glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
glBindTexture(GL_TEXTURE_2D, 0);
glBegin(GL_QUADS);
@ -547,6 +549,15 @@ void Engine::DrawOption()
glTexCoord2f(0, 1); glVertex2i(centerX - Width() * 0.175, centerY + Height() * 0.25);
glEnd();
glColor4f(0.85f, 0.95f, 0.0f, 1.0f);
m_textureRetour.Bind();
glBegin(GL_QUADS);
glTexCoord2f(0, 0); glVertex2i(centerX - Width() * 0.075, centerY - Height() * 0.25);
glTexCoord2f(1, 0); glVertex2i(centerX + Width() * 0.075, centerY - Height() * 0.25);
glTexCoord2f(1, 1); glVertex2i(centerX + Width() * 0.075, centerY - Height() * 0.2);
glTexCoord2f(0, 1); glVertex2i(centerX - Width() * 0.075, centerY - Height() * 0.2);
glEnd();
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
if (m_selectedOption == 0) {
@ -1813,6 +1824,11 @@ void Engine::MousePressEvent(const MOUSE_BUTTON& button, int x, int y) {
float topGameplay = centerY + Height() * 0.1f;
float bottomGameplay = centerY + Height() * 0.05f;
float leftRetour = centerX - Width() * 0.075f;
float rightRetour = centerX + Width() * 0.075f;
float topRetour = centerY + Height() * 0.25f;
float bottomRetour = centerY + Height() * 0.2f;
if (x > leftVol && x < rightVol && y > bottomVol && y < topVol) {
m_selectedOption = 0; // Volume
}
@ -1822,6 +1838,9 @@ void Engine::MousePressEvent(const MOUSE_BUTTON& button, int x, int y) {
else if (x > leftGameplay && x < rightGameplay && y > bottomGameplay && y < topGameplay) {
m_selectedOption = 2; // Gameplay
}
else if (x > leftRetour && x < rightRetour && y > bottomRetour && y < topRetour) {
m_gamestate = GameState::MAIN_MENU;
}
// Volume
float leftBar = centerX - Width() * 0.15f;

View File

@ -92,6 +92,7 @@ private:
Texture m_textureMultiText;
Texture m_textureTitle;
Texture m_textureOptions;
Texture m_textureRetour;
Texture m_textureVolume;
Texture m_textureMusique;
Texture m_textureGraphiques;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB