Class StatisticsScreen

java.lang.Object
com.badlogic.gdx.ScreenAdapter
com.csse3200.game.screens.StatisticsScreen
All Implemented Interfaces:
com.badlogic.gdx.Screen

public class StatisticsScreen extends com.badlogic.gdx.ScreenAdapter
The StatisticsScreen is a game screen containing the player's Statistics.

It sets up the rendering, input and services for the UI to function and manages a StatisticsDisplay component that displays the actual Statistics.

  • Field Details

    • game

      protected final GdxGame game
    • renderer

      protected final Renderer renderer
    • backgroundTexture

      protected final Optional<String> backgroundTexture
    • additionalTextures

      protected final Optional<String[]> additionalTextures
  • Constructor Details

    • StatisticsScreen

      public StatisticsScreen(GdxGame gdxGame)
      Creates a new StatisticsScreen and registers the services required, creates the renderer, and initialises the Statistics UI.
      Parameters:
      gdxGame - current game instance
  • Method Details

    • constructEntity

      protected Entity constructEntity(com.badlogic.gdx.scenes.scene2d.Stage stage)
      Creates the StatisticsScreen's UI including components for rendering UI elements to the screen and capturing and handling UI input.
      Parameters:
      stage - the stage to create the UI screen on
      Returns:
      the UI entity
    • render

      public void render(float delta)
      Specified by:
      render in interface com.badlogic.gdx.Screen
      Overrides:
      render in class com.badlogic.gdx.ScreenAdapter
    • resize

      public void resize(int width, int height)
      Specified by:
      resize in interface com.badlogic.gdx.Screen
      Overrides:
      resize in class com.badlogic.gdx.ScreenAdapter
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.Screen
      Overrides:
      dispose in class com.badlogic.gdx.ScreenAdapter