Package com.skloch.game
Class SettingsScreen
java.lang.Object
com.skloch.game.SettingsScreen
- All Implemented Interfaces:
com.badlogic.gdx.Screen
A screen to display settings to the player, lets the player adjust sound and music volume
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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
ConstructorsConstructorDescriptionSettingsScreen
(HustleGame game, com.badlogic.gdx.Screen previousScreen) Handles the configuration of Music and Sound effect volume using two sliders -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes of the option settings stagevoid
hide()
void
pause()
void
render
(float delta) Renders a settings screen to let the player configure music and sound volumevoid
resize
(int width, int height) Correctly resizes the settings screenvoid
resume()
void
show()
-
Field Details
-
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
Handles the configuration of Music and Sound effect volume using two sliders- Parameters:
game
- An instance of HustleGamepreviousScreen
- 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 interfacecom.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 interfacecom.badlogic.gdx.Screen
- Parameters:
width
-height
-
-
show
public void show()- Specified by:
show
in interfacecom.badlogic.gdx.Screen
-
hide
public void hide()- Specified by:
hide
in interfacecom.badlogic.gdx.Screen
-
pause
public void pause()- Specified by:
pause
in interfacecom.badlogic.gdx.Screen
-
resume
public void resume()- Specified by:
resume
in interfacecom.badlogic.gdx.Screen
-
dispose
public void dispose()Disposes of the option settings stage- Specified by:
dispose
in interfacecom.badlogic.gdx.Screen
-