Package com.dragonboatrace.screens
Class BoatSelectScreen
- java.lang.Object
-
- com.dragonboatrace.screens.BoatSelectScreen
-
- All Implemented Interfaces:
com.badlogic.gdx.Screen
public class BoatSelectScreen extends java.lang.Object implements com.badlogic.gdx.Screen
Displays the screen that allows the player to choose a boat at the beginning of the game.
-
-
Field Summary
Fields Modifier and Type Field Description 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 boat 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 BoatSelectScreen(DragonBoatRace game)
Creates a new screen to display the boat 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 boat 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 boat 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
-
-
Constructor Detail
-
BoatSelectScreen
public BoatSelectScreen(DragonBoatRace game)
Creates a new screen to display the boat options to the player.- Parameters:
game
- The instance of theDragonBoatRace
game.
-
-
Method Detail
-
show
public void show()
- Specified by:
show
in interfacecom.badlogic.gdx.Screen
-
render
public void render(float delta)
Renders the boat 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
-
-