public class PlayerSelectScreen
extends java.lang.Object
implements com.badlogic.gdx.Screen
Modifier and Type | Field and Description |
---|---|
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
addAIPlayerButton
increase number of AI players
|
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
addPlayerButton
increase number of human players
|
private int |
AIPlayerAmount
variable to store number of AI players
|
private com.badlogic.gdx.scenes.scene2d.ui.Label |
AIPlayerAmountLabel
display number of AI players
|
private com.badlogic.gdx.scenes.scene2d.ui.Label |
AIPlayerLabel
show which part of the screen changes the number of AI players
|
private com.badlogic.gdx.graphics.g2d.Sprite |
background
The object which will encode the menu's background
|
private com.badlogic.gdx.graphics.g2d.SpriteBatch |
batch
Batch that manages the rendering pipeline for all of the images to be displayed on the screen
|
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
confirmButton
button to confirm number of players
|
private Drawer |
drawer
Object defining QOL drawing functions for rectangles and on-screen tables
Used in this class accelerate table row creation
|
private GameEngine |
engine |
private com.badlogic.gdx.Game |
game
Stores current game-state, enabling transitions between screens and external QOL drawing functions
|
private GameScreen |
gameScreen |
private TTFont |
menuFont
Establishes the font which is used to encode the menu's options
|
private int |
playerAmount
variable to store number of human players
|
private com.badlogic.gdx.scenes.scene2d.ui.Label |
playerAmountLabel
display number of human players
|
private com.badlogic.gdx.scenes.scene2d.ui.Label |
playerLabel
show which part of the screen changes the number of human players
|
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
removeAIPlayerButton
decrease number of AI players
|
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
removePlayerButton
decrease number of human players
|
private com.badlogic.gdx.scenes.scene2d.Stage |
stage
On-screen stage which can be populated with actors
|
private com.badlogic.gdx.scenes.scene2d.ui.Table |
table
Provides the spatial framework for menu buttons and labels to be organised over
|
Constructor and Description |
---|
PlayerSelectScreen(com.badlogic.gdx.Game game)
The menu-screen's initial constructor
|
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
void |
hide() |
void |
initialisePlayers(GameEngine engine,
int AIAmount,
int playerAmount) |
void |
pause() |
void |
refreshLabels()
update labels and buttons on screen
disable buttons which should not be pressed
change numbers displayed when incremented/decremented
|
void |
render(float delta) |
void |
resize(int width,
int height) |
void |
resume() |
void |
show() |
private com.badlogic.gdx.Game game
private com.badlogic.gdx.scenes.scene2d.Stage stage
private com.badlogic.gdx.scenes.scene2d.ui.Table table
private TTFont menuFont
private Drawer drawer
private com.badlogic.gdx.graphics.g2d.SpriteBatch batch
private com.badlogic.gdx.graphics.g2d.Sprite background
private com.badlogic.gdx.scenes.scene2d.ui.TextButton addPlayerButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton addAIPlayerButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton removePlayerButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton removeAIPlayerButton
private com.badlogic.gdx.scenes.scene2d.ui.Label playerLabel
private com.badlogic.gdx.scenes.scene2d.ui.Label AIPlayerLabel
private com.badlogic.gdx.scenes.scene2d.ui.Label playerAmountLabel
private com.badlogic.gdx.scenes.scene2d.ui.Label AIPlayerAmountLabel
private com.badlogic.gdx.scenes.scene2d.ui.TextButton confirmButton
private int playerAmount
private int AIPlayerAmount
private GameEngine engine
private GameScreen gameScreen
public PlayerSelectScreen(com.badlogic.gdx.Game game)
game
- Variable storing the game's state for rendering purposespublic void show()
show
in interface com.badlogic.gdx.Screen
public void render(float delta)
render
in interface com.badlogic.gdx.Screen
public void resize(int width, int height)
resize
in interface com.badlogic.gdx.Screen
public void pause()
pause
in interface com.badlogic.gdx.Screen
public void resume()
resume
in interface com.badlogic.gdx.Screen
public void hide()
hide
in interface com.badlogic.gdx.Screen
public void dispose()
dispose
in interface com.badlogic.gdx.Screen
public void refreshLabels()
public void initialisePlayers(GameEngine engine, int AIAmount, int playerAmount)