Package de.tum.cit.fop.maze.UI
Class MenuScreen
java.lang.Object
de.tum.cit.fop.maze.UI.MenuScreen
- All Implemented Interfaces:
com.badlogic.gdx.Screen
The MenuScreen class is responsible for displaying the main menu of the game.
It extends the LibGDX Screen class and sets up the UI components for the menu.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Disposes of the screen and its resources.Returns the SoundController used by this screen.com.badlogic.gdx.utils.viewport.ViewportReturns the Viewport used by this screen.voidSwitches back to the main menu UI.voidSwitches to the Achievements UI.voidSwitches to the Endless Mode UI.voidSwitches to the Leaderboard UI.voidSwitches to the Level Mode UI.voidSwitches to the Settings UI.voidSwitches to the Story Mode UI.voidhide()Called when this screen is no longer the current screen for the game.voidpause()Called when the application is paused.voidrender(float delta) Renders the screen.voidresize(int width, int height) Called when the screen size changes.voidresume()Called when the application is resumed from a paused state.voidshow()Called when this screen becomes the current screen for the game.
-
Constructor Details
-
MenuScreen
Constructor for MenuScreen. Sets up the camera, viewport, stage, and UI elements.- Parameters:
game- The main game class, used to access global resources and methods.
-
-
Method Details
-
render
public void render(float delta) Renders the screen.- Specified by:
renderin interfacecom.badlogic.gdx.Screen- Parameters:
delta- The time in seconds since the last render.
-
resize
public void resize(int width, int height) Called when the screen size changes.- Specified by:
resizein interfacecom.badlogic.gdx.Screen- Parameters:
width- The new width.height- The new height.
-
dispose
public void dispose()Disposes of the screen and its resources.- Specified by:
disposein interfacecom.badlogic.gdx.Screen
-
show
public void show()Called when this screen becomes the current screen for the game.- Specified by:
showin interfacecom.badlogic.gdx.Screen
-
pause
public void pause()Called when the application is paused.- Specified by:
pausein interfacecom.badlogic.gdx.Screen
-
resume
public void resume()Called when the application is resumed from a paused state.- Specified by:
resumein interfacecom.badlogic.gdx.Screen
-
hide
public void hide()Called when this screen is no longer the current screen for the game.- Specified by:
hidein interfacecom.badlogic.gdx.Screen
-
goToStory
public void goToStory()Switches to the Story Mode UI. -
goToLevel
public void goToLevel()Switches to the Level Mode UI. -
goBackToMenu
public void goBackToMenu()Switches back to the main menu UI. -
goToSettings
public void goToSettings()Switches to the Settings UI. -
goToEndless
public void goToEndless()Switches to the Endless Mode UI. -
goToLeaderboard
public void goToLeaderboard()Switches to the Leaderboard UI. -
goToAchievements
public void goToAchievements()Switches to the Achievements UI. -
getSoundController
Returns the SoundController used by this screen.- Returns:
- The SoundController.
-
getViewport
public com.badlogic.gdx.utils.viewport.Viewport getViewport()Returns the Viewport used by this screen.- Returns:
- The Viewport.
-