MAIN MENU AND SETTING MENU DISPLAY CHANGES - UQcsse3200/2023-studio-2 GitHub Wiki
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
The base of the main menu screen's background:
The base of the settings screen's background:
Added visual effects
In the MainMenuDisplay class, the background is initialized with the following code:
The buttons that are necessary for the main menu are initialized with the following code:
The buttons are given listeners to ensure that they work when pressed, and do not do anything when unpressed.
Settings Display
In the SettingsMenuDisplay class, images are added to enhance the visual appeal of the main menu as shown below:
Main Menu
Settings Menu
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
Starry Background Explanation
The MainMenuDisplay
class, imports a class called MainMenuStarBackground
. This class is responsible for animating the main menu screen. It works via:
The creation of stars via the MainMenuStarBackground
constructor, which involves:
Iterating through each of the star animation sprites via a for loop.
Setting the animation style of the stars, and the area of the screen they can take up.
The same is done for the settings menu background. The SettingsMenuDisplay
class, imports a class called SettingsStarBackground
. This class is responsible for animating the settings screen.
Dependencies
- LibGDX: The core framework for developing cross-platform games.
Contributors
-
Yash Mittal @YashMitttal
-
Aniket Gupta @aniketgupta17
-
Neil Barigye @neil-nb