Push bouton pour retourner au menu principal. Makeover des anciens boutons.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user