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 BoatTypeboatTypeprivate Button[]buttonsArray storing all buttons (each button keeps track of its own texture)private intbuttonWidthprivate com.badlogic.gdx.graphics.g2d.BitmapFontfontprivate DragonBoatRacegameInstance of the main game, used to have a collective spritebatch which gives better performance.private com.badlogic.gdx.graphics.Texture[]iconTexturesArray storing all icon texturesprivate com.badlogic.gdx.graphics.g2d.GlyphLayoutlayoutprivate java.lang.String[]textureNamesArray storing all texture names (they will later be combined with .png and _button)private java.lang.Stringtitle
-
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 voiddispose()voidhide()voidpause()voidrender(float delta)Renders the difficulty selection screen.voidresize(int width, int height)voidresume()voidshow()
-
-
-
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 theDragonBoatRacegame.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:
showin interfacecom.badlogic.gdx.Screen
-
render
public void render(float delta)
Renders the difficulty selection screen.- Specified by:
renderin interfacecom.badlogic.gdx.Screen- Parameters:
delta- The time passed since the last frame.
-
resize
public void resize(int width, int height)- Specified by:
resizein 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
-
hide
public void hide()
- Specified by:
hidein interfacecom.badlogic.gdx.Screen
-
dispose
public void dispose()
- Specified by:
disposein interfacecom.badlogic.gdx.Screen
-
-