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.ScreenDisplays 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[]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 boat 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 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 voiddispose()voidhide()voidpause()voidrender(float delta)Renders the boat 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 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 theDragonBoatRacegame.
-
-
Method Detail
-
show
public void show()
- Specified by:
showin interfacecom.badlogic.gdx.Screen
-
render
public void render(float delta)
Renders the boat 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
-
-