Skip to content

MAIN MENU AND SETTING MENU DISPLAY CHANGES

YashMitttal edited this page Sep 14, 2023 · 9 revisions

Overview

The MainMenuDisplay and class is a UI component responsible for displaying the main menu of the game. It allows users to navigate and interact with various menu options. This documentation focuses on adding static images to run an animation the main menu.

Table of Contents

Added Visual effects

Methods

Animation

Dependencies

Contributors

Added visual effects

  • In the MainMenuDisplay class, static images are added which runs as an animation to enhance the visual appeal of the main menu. Here's how it's done:
Screenshot 2023-09-14 at 12 01 01 PM
  • In the SettingsMenuDisplay class, images are added to enhance the visual appeal of the main menu. Here's how it's done:
Screenshot 2023-08-31 at 1 42 40 AM
  • This is the final output of the Main Menu screen Display

Screenshot 2023-09-14 at 12 07 11 PM

  • This is the Final output of the Settings Screen Display

Screenshot 2023-09-14 at 12 45 41 PM

Methods

create() The create method is called during component creation and is responsible for setting up the main menu's UI elements, including the title image and menu buttons

Animation Code Explanation

In the MainMenuDisplay class, we have a method called AmendAnimation(). This method is responsible for animating the main menu screen. Here's a breakdown of how it works:

  • frame is a variable that keeps track of the current animation frame.
  • MainMenuScreen.MountedFrames is the total number of frames in the animation.
  • transitionFrames is an object that represents the animation frame being displayed.
  • lastFrameTime stores the time when the last frame was updated.

AmendAnimation()

This method is called to update the animation frame. It does the following:

  1. Checks if the current frame is less than the total number of frames.
  2. If yes, it updates transitionFrames with the next frame's texture.
  3. Sets the dimensions of transitionFrames to match the screen size.
  4. Advances the frame counter and updates lastFrameTime.
  5. If all frames have been shown, it resets frame to 1.
Screenshot 2023-09-14 at 12 12 54 PM

Dependencies

  • LibGDX: The core framework for developing cross-platform games.

Contributors

Clone this wiki locally