Class SettingsScreen

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

public class SettingsScreen extends Object implements com.badlogic.gdx.Screen
A screen to display settings to the player, lets the player adjust sound and music volume
  • Field Summary

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

    Constructors
    Constructor
    Description
    SettingsScreen(HustleGame game, com.badlogic.gdx.Screen previousScreen)
    Handles the configuration of Music and Sound effect volume using two sliders
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Disposes of the option settings stage
    void
     
    void
     
    void
    render(float delta)
    Renders a settings screen to let the player configure music and sound volume
    void
    resize(int width, int height)
    Correctly resizes the settings screen
    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
    • optionStage

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

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

      private com.badlogic.gdx.utils.viewport.Viewport viewport
    • optionMenu

      private com.badlogic.gdx.scenes.scene2d.ui.Window optionMenu
    • musicSlider

      public com.badlogic.gdx.scenes.scene2d.ui.Slider musicSlider
    • sfxSlider

      public com.badlogic.gdx.scenes.scene2d.ui.Slider sfxSlider
    • previousScreen

      public com.badlogic.gdx.Screen previousScreen
  • Constructor Details

    • SettingsScreen

      public SettingsScreen(HustleGame game, com.badlogic.gdx.Screen previousScreen)
      Handles the configuration of Music and Sound effect volume using two sliders
      Parameters:
      game - An instance of HustleGame
      previousScreen - The previous screen to return to when the exit button is rpessed
  • Method Details

    • render

      public void render(float delta)
      Renders a settings screen to let the player configure music and sound volume
      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 settings screen
      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()
      Disposes of the option settings stage
      Specified by:
      dispose in interface com.badlogic.gdx.Screen