public class StatusBar
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static com.badlogic.gdx.graphics.Color |
BACKGROUND_COLOR
The background color of the StatusBar
|
private com.badlogic.gdx.scenes.scene2d.ui.Skin |
buttonSkin
The different skins for different elements
|
private GameMain |
game |
static int |
HEIGHT
The height of the StatusBar
|
private static int |
ITEM_COUNT
The amount of items that are in the StatusBar
|
private com.badlogic.gdx.scenes.scene2d.ui.Skin |
labelSkin |
private PauseScreen |
pauseScreen |
private com.badlogic.gdx.scenes.scene2d.ui.Label |
personalityLabel |
private com.badlogic.gdx.scenes.scene2d.ui.Label |
scoreLabel |
com.badlogic.gdx.scenes.scene2d.Stage |
stage
The stage to render the elements to
|
private static int |
WIDTH
The width of the StatusBar
|
Constructor and Description |
---|
StatusBar(GameMain game)
The initializer for the StatusBar
Sets up UI controls and adds them to the stage ready for rendering
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
This disposes all the elements
|
private void |
initButtonSkin()
Sets up the skin for buttons on the status bar
|
private void |
initLabelSkin()
Sets up the skin for labels on the status bar
|
private void |
initSkins()
Sets up skin variables used for defining UI control styles
|
void |
renderMain()
Renders the status bar
Should be called within the render() method of a screen
|
void |
resize(int width,
int height)
This method is called on a window resize
|
void |
updateMain()
Updates the status bar
|
public static final int HEIGHT
private static final int ITEM_COUNT
private static final int WIDTH
private static final com.badlogic.gdx.graphics.Color BACKGROUND_COLOR
public com.badlogic.gdx.scenes.scene2d.Stage stage
private com.badlogic.gdx.scenes.scene2d.ui.Skin buttonSkin
private com.badlogic.gdx.scenes.scene2d.ui.Skin labelSkin
private PauseScreen pauseScreen
private com.badlogic.gdx.scenes.scene2d.ui.Label scoreLabel
private com.badlogic.gdx.scenes.scene2d.ui.Label personalityLabel
private GameMain game
public StatusBar(GameMain game)
public void updateMain()
public void renderMain()
public void resize(int width, int height)
width
- - the new widthheight
- - the new heightpublic void dispose()
private void initSkins()
private void initButtonSkin()
private void initLabelSkin()