Package com.dragonboatrace.screens
Class DifficultySelectScreen
- java.lang.Object
-
- com.dragonboatrace.screens.DifficultySelectScreen
-
- All Implemented Interfaces:
com.badlogic.gdx.Screen
public class DifficultySelectScreen extends java.lang.Object implements com.badlogic.gdx.Screen
-
-
Field Summary
Fields Modifier and Type Field Description private BoatType
boatType
private Button[]
buttons
Array storing all buttons (each button keeps track of its own texture)private int
buttonWidth
private com.badlogic.gdx.graphics.g2d.BitmapFont
font
private DragonBoatRace
game
Instance of the main game, used to have a collective spritebatch which gives better performance.private com.badlogic.gdx.graphics.Texture[]
iconTextures
Array storing all icon texturesprivate com.badlogic.gdx.graphics.g2d.GlyphLayout
layout
private java.lang.String[]
textureNames
Array storing all texture names (they will later be combined with .png and _button)private java.lang.String
title
-
Constructor Summary
Constructors Constructor Description DifficultySelectScreen(DragonBoatRace game, BoatType boatType)
Creates a new screen to display the difficulty options to the player.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
void
hide()
void
pause()
void
render(float delta)
Renders the difficulty selection screen.void
resize(int width, int height)
void
resume()
void
show()
-
-
-
Field Detail
-
textureNames
private final java.lang.String[] textureNames
Array storing all texture names (they will later be combined with .png and _button)
-
iconTextures
private final com.badlogic.gdx.graphics.Texture[] iconTextures
Array storing all icon textures
-
buttons
private final Button[] buttons
Array storing all buttons (each button keeps track of its own texture)
-
game
private final DragonBoatRace game
Instance of the main game, used to have a collective spritebatch which gives better performance.
-
font
private final com.badlogic.gdx.graphics.g2d.BitmapFont font
-
layout
private final com.badlogic.gdx.graphics.g2d.GlyphLayout layout
-
title
private final java.lang.String title
- See Also:
- Constant Field Values
-
buttonWidth
private final int buttonWidth
-
boatType
private final BoatType boatType
-
-
Constructor Detail
-
DifficultySelectScreen
public DifficultySelectScreen(DragonBoatRace game, BoatType boatType)
Creates a new screen to display the difficulty options to the player.- Parameters:
game
- The instance of theDragonBoatRace
game.boatType
- The boat type selected on the previous screen which is to be passed to the MainGameScreen
-
-
Method Detail
-
show
public void show()
- Specified by:
show
in interfacecom.badlogic.gdx.Screen
-
render
public void render(float delta)
Renders the difficulty selection screen.- Specified by:
render
in interfacecom.badlogic.gdx.Screen
- Parameters:
delta
- The time passed since the last frame.
-
resize
public void resize(int width, int height)
- Specified by:
resize
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
-
hide
public void hide()
- Specified by:
hide
in interfacecom.badlogic.gdx.Screen
-
dispose
public void dispose()
- Specified by:
dispose
in interfacecom.badlogic.gdx.Screen
-
-