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.OrthographicCameraprivate HustleGamecom.badlogic.gdx.scenes.scene2d.ui.Sliderprivate com.badlogic.gdx.scenes.scene2d.ui.Windowprivate com.badlogic.gdx.scenes.scene2d.Stagecom.badlogic.gdx.Screencom.badlogic.gdx.scenes.scene2d.ui.Sliderprivate 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 TypeMethodDescriptionvoiddispose()Disposes of the option settings stagevoidhide()voidpause()voidrender(float delta) Renders a settings screen to let the player configure music and sound volumevoidresize(int width, int height) Correctly resizes the settings screenvoidresume()voidshow()
-
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:
renderin 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:
resizein interfacecom.badlogic.gdx.Screen- Parameters:
width-height-
-
show
public void show()- Specified by:
showin interfacecom.badlogic.gdx.Screen
-
hide
public void hide()- Specified by:
hidein interfacecom.badlogic.gdx.Screen
-
pause
public void pause()- Specified by:
pausein interfacecom.badlogic.gdx.Screen
-
resume
public void resume()- Specified by:
resumein interfacecom.badlogic.gdx.Screen
-
dispose
public void dispose()Disposes of the option settings stage- Specified by:
disposein interfacecom.badlogic.gdx.Screen
-