diff options
author | nathansmith117 <thenathansmithsmith@gmail.com> | 2024-02-16 17:56:03 +0000 |
---|---|---|
committer | nathansmith117 <thenathansmithsmith@gmail.com> | 2024-02-16 17:56:03 +0000 |
commit | 2150113f50b5a51b74594310d12cca55b9886e14 (patch) | |
tree | 401d4eaf94f428599fdafeed2eac119852e44358 /src/mainMenu.c | |
parent | 3631e9c1888d2d2e43e85af654fc0544594795f2 (diff) | |
download | PenguinYippies-2150113f50b5a51b74594310d12cca55b9886e14.tar.gz PenguinYippies-2150113f50b5a51b74594310d12cca55b9886e14.tar.bz2 PenguinYippies-2150113f50b5a51b74594310d12cca55b9886e14.zip |
Main menu background added
Diffstat (limited to 'src/mainMenu.c')
-rw-r--r-- | src/mainMenu.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mainMenu.c b/src/mainMenu.c index 370b71f..6041e4b 100644 --- a/src/mainMenu.c +++ b/src/mainMenu.c @@ -5,24 +5,24 @@ void initMainMenu(MainMenu* mainMenu, Game* game) { mainMenu->startButtonAnimation = createAnimation( - &game->assets.animations[PENGUIN_LOL_ANIMATION], + &game->assets.animations[BUTTON_BOX_ANIMATION], ANIMATION_DEFAULT_DELAY ); } void updateMainMenu(MainMenu* mainMenu, Game* game) { - ClearBackground(RAYWHITE); + // Draw background. + Texture background = game->assets.textures[PENGUIN_BACKGROUND_TEXTURE]; - DrawTextureEx(mainMenu->startButtonAnimation.texture, (Vector2){100.0, 100.0}, 0.0, 0.1, WHITE); - runAnimation(&mainMenu->startButtonAnimation); - - if (IsKeyPressed(KEY_SPACE)) - { - toggleAnimation(&mainMenu->startButtonAnimation); - } - - DrawFPS(0, 0); + DrawTexturePro( + background, + (Rectangle){0.0, 0.0, background.width, background.height}, + (Rectangle){0.0, 0.0, GetScreenWidth(), GetScreenHeight()}, + (Vector2){0.0, 0.0}, + 0.0, + WHITE + ); } void closeMainMenu(MainMenu* mainMenu) |