Class CreditScreen

java.lang.Object
com.skloch.game.CreditScreen
All Implemented Interfaces:
com.badlogic.gdx.Screen

public class CreditScreen extends Object implements com.badlogic.gdx.Screen
A scene2d window consisting of a title, a scrollable widget and an exit button. Used to display the assets used in the game
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private com.badlogic.gdx.graphics.OrthographicCamera
     
    private com.badlogic.gdx.scenes.scene2d.Stage
     
    private HustleGame
     
    private com.badlogic.gdx.utils.viewport.Viewport
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CreditScreen(HustleGame game, com.badlogic.gdx.Screen previousScreen)
    A scene2d window consisting of a title, a scrollable widget and an exit button.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    void
     
    void
    render(float delta)
    Renders the credits window
    void
    resize(int width, int height)
    Correctly resizes the onscreen elements when the window is resized
    void
     
    void
     

    Methods inherited from class java.lang.Object

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

    • game

      private HustleGame game
    • creditStage

      private com.badlogic.gdx.scenes.scene2d.Stage creditStage
    • camera

      private com.badlogic.gdx.graphics.OrthographicCamera camera
    • viewport

      private com.badlogic.gdx.utils.viewport.Viewport viewport
  • Constructor Details

    • CreditScreen

      public CreditScreen(HustleGame game, com.badlogic.gdx.Screen previousScreen)
      A scene2d window consisting of a title, a scrollable widget and an exit button. Credits are loaded from assets/Text/credits.txt and displayed in the scrollable widget Thus any changes to assets or licenses must be reflected in credits.txt
      Parameters:
      game - An instance of the HustleGame class
      previousScreen - The screen to return to when the exit button is pressed
  • Method Details

    • render

      public void render(float delta)
      Renders the credits window
      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)
      Correctly resizes the onscreen elements when the window is resized
      Specified by:
      resize in interface com.badlogic.gdx.Screen
      Parameters:
      width -
      height -
    • show

      public void show()
      Specified by:
      show in interface com.badlogic.gdx.Screen
    • hide

      public void hide()
      Specified by:
      hide in interface com.badlogic.gdx.Screen
    • pause

      public void pause()
      Specified by:
      pause in interface com.badlogic.gdx.Screen
    • resume

      public void resume()
      Specified by:
      resume in interface com.badlogic.gdx.Screen
    • dispose

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