Class MenuScreen

java.lang.Object
de.tum.cit.fop.maze.UI.MenuScreen
All Implemented Interfaces:
com.badlogic.gdx.Screen

public class MenuScreen extends Object implements 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
    Constructor
    Description
    Constructor for MenuScreen.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Disposes of the screen and its resources.
    Returns the SoundController used by this screen.
    com.badlogic.gdx.utils.viewport.Viewport
    Returns the Viewport used by this screen.
    void
    Switches back to the main menu UI.
    void
    Switches to the Achievements UI.
    void
    Switches to the Endless Mode UI.
    void
    Switches to the Leaderboard UI.
    void
    Switches to the Level Mode UI.
    void
    Switches to the Settings UI.
    void
    Switches to the Story Mode UI.
    void
    Called when this screen is no longer the current screen for the game.
    void
    Called when the application is paused.
    void
    render(float delta)
    Renders the screen.
    void
    resize(int width, int height)
    Called when the screen size changes.
    void
    Called when the application is resumed from a paused state.
    void
    Called when this screen becomes the current screen for the game.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MenuScreen

      public MenuScreen(MazeRunnerGame game)
      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:
      render in interface com.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:
      resize in interface com.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:
      dispose in interface com.badlogic.gdx.Screen
    • show

      public void show()
      Called when this screen becomes the current screen for the game.
      Specified by:
      show in interface com.badlogic.gdx.Screen
    • pause

      public void pause()
      Called when the application is paused.
      Specified by:
      pause in interface com.badlogic.gdx.Screen
    • resume

      public void resume()
      Called when the application is resumed from a paused state.
      Specified by:
      resume in interface com.badlogic.gdx.Screen
    • hide

      public void hide()
      Called when this screen is no longer the current screen for the game.
      Specified by:
      hide in interface com.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

      public SoundController 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.