diff --git a/Pontu/entryPoints/main.c b/Pontu/entryPoints/main.c index a669351..dfeb445 100644 --- a/Pontu/entryPoints/main.c +++ b/Pontu/entryPoints/main.c @@ -73,9 +73,10 @@ int main(int argc, char *argv[]) { }*/ generalState = GS_Game; - //gameView(&generalState, window, renderer, players, nbPlayers, &fontHandler); + gameView(&generalState, window, renderer, players, nbPlayers, &fontHandler); //Pour tester le endGameMenu directement + /* generalState = GS_EndOfGameMenu; players[0].eliminationTurn = 10; players[0].rank = 3; @@ -83,6 +84,7 @@ int main(int argc, char *argv[]) { players[1].rank = 2; players[2].eliminationTurn = 0; players[2].rank = 1; + */ endGameMenu(&generalState, window, renderer, &fontHandler, players, nbPlayers); break; diff --git a/Pontu/rsrc/img/Settings.png b/Pontu/rsrc/img/Settings.png new file mode 100644 index 0000000..29d1e70 Binary files /dev/null and b/Pontu/rsrc/img/Settings.png differ diff --git a/Pontu/rsrc/img/SettingsResized.png b/Pontu/rsrc/img/SettingsResized.png new file mode 100644 index 0000000..1e4d7df Binary files /dev/null and b/Pontu/rsrc/img/SettingsResized.png differ diff --git a/Pontu/rsrc/img/Sound.png b/Pontu/rsrc/img/Sound.png new file mode 100644 index 0000000..e787274 Binary files /dev/null and b/Pontu/rsrc/img/Sound.png differ diff --git a/Pontu/rsrc/img/SoundResized.png b/Pontu/rsrc/img/SoundResized.png new file mode 100644 index 0000000..132461f Binary files /dev/null and b/Pontu/rsrc/img/SoundResized.png differ diff --git a/Pontu/src/view/GameInterface.c b/Pontu/src/view/GameInterface.c index b685c61..6d65b11 100644 --- a/Pontu/src/view/GameInterface.c +++ b/Pontu/src/view/GameInterface.c @@ -16,20 +16,30 @@ void action(P_Button* buttonCaller){ struct array_P_Button createGameInterfaceButtons(SDL_Renderer* renderer, FontHandler* fontHandler) { SDL_Color menuBorderColor= {0,0,255,255}; SDL_Color menuBackgroundColor = {0,255,0,255}; + //SDL_Color menuBackgroundColor = {0,0,255,255}; + int sizex=20,sizey=20; - SDL_Texture *menuButtonTexture = createGenericButtonTexture("Menu", fontHandler->fonts[FONT_retro], 125, menuBorderColor,menuBorderColor,24,5,&sizex,&sizey,renderer); - SDL_Texture *menuButtonHoverTexture = createGenericButtonTexture("MenuHover", fontHandler->fonts[FONT_retro], 125, menuBorderColor,menuBackgroundColor,24,5,&sizex,&sizey,renderer); + SDL_Texture *menuButtonTexture = createGenericButtonTexture("Menu", fontHandler->fonts[FONT_retro], 15, menuBorderColor,menuBackgroundColor,13,5,&sizex,&sizey,renderer); + SDL_Texture *menuButtonHoverTexture = createGenericButtonTexture("MenuHover", fontHandler->fonts[FONT_retro], 15, menuBorderColor,menuBackgroundColor,13,5,&sizex,&sizey,renderer); + + SDL_Texture *settingsButtonTexture = createTextureFromPath(renderer,"rsrc/img/SettingsResized.png"); + //SDL_Texture *settingsButtonTexture = createGenericButtonTexture("Settings", fontHandler->fonts[FONT_retro], 15, menuBorderColor,menuBackgroundColor,13,5,&sizex,&sizey,renderer); + SDL_Texture *settingsButtonHoverTexture = createGenericButtonTexture("SettingsHover", fontHandler->fonts[FONT_retro], 15, menuBorderColor,menuBackgroundColor,13,5,&sizex,&sizey,renderer); + + //SDL_Texture *muteButtonTexture = createTextureFromPath(renderer,"rsrc/img/SoundResized"); + SDL_Texture *muteButtonTexture = createGenericButtonTexture("Mute", fontHandler->fonts[FONT_retro], 15, menuBorderColor,menuBackgroundColor,13,5,&sizex,&sizey,renderer); + SDL_Texture *muteButtonHoverTexture = createGenericButtonTexture("MuteHover", fontHandler->fonts[FONT_retro], 15, menuBorderColor,menuBackgroundColor,13,5,&sizex,&sizey,renderer); struct array_P_Button buttons = array_P_Button_Create(); // Menu array_P_Button_AddElement(&buttons, createButton(menuButtonTexture, menuButtonHoverTexture,20,20,100,50,&action)); //top left corner (rectangle) // Settings - array_P_Button_AddElement(&buttons, createButton(menuButtonTexture, menuButtonHoverTexture, 750,10,50,50,&action)); //top right corner (square or circle) + array_P_Button_AddElement(&buttons, createButton(settingsButtonTexture, settingsButtonHoverTexture, 750,10,50,50,&action)); //top right corner (square or circle) // Mute/Unmute - array_P_Button_AddElement(&buttons, createButton(menuButtonTexture, menuButtonHoverTexture, 825,10,50,50,&action)); //top right cornre (square or circle) + array_P_Button_AddElement(&buttons, createButton(muteButtonTexture, muteButtonHoverTexture, 825,10,50,50,&action)); //top right cornre (square or circle) return buttons; }