public class SplashScreen
extends java.lang.Object
implements com.badlogic.gdx.Screen
Modifier and Type | Field and Description |
---|---|
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 int |
delay
Variable storing the number of seconds over which the splash screen will hang
|
private com.badlogic.gdx.Game |
game
Stores current game-state, enabling transitions between screens
|
private com.badlogic.gdx.InputProcessor |
inputProcessor
Enables keyboard inputs to be registered and bound to functions
Used in this context to permit skipping the splash screen by hitting the keyboard or clicking the mouse
|
private com.badlogic.gdx.graphics.g2d.Sprite |
logo
The object which will encode the team's logo
|
private com.badlogic.gdx.utils.Timer |
timer
Timer which will temporarily stall the splash screen before it gives way to the main menu
|
Constructor and Description |
---|
SplashScreen(com.badlogic.gdx.Game game)
The constructor for the splash screen.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes of all visual data used to construct previous frames
This is called after each frame is rendered, and remains necessary to prevent memory leaks
|
void |
hide() |
void |
pause() |
void |
render(float delta)
Renders all visual elements (set up in the [show()] subroutine and all of its subsiduaries) to the window
This is called to prepare each and every frame that the screen deploys
|
void |
resize(int width,
int height) |
void |
resume() |
void |
show()
Acts as a secondary constructor for the screen.
|
private com.badlogic.gdx.Game game
private com.badlogic.gdx.graphics.g2d.SpriteBatch batch
private com.badlogic.gdx.graphics.g2d.Sprite logo
private com.badlogic.gdx.utils.Timer timer
private int delay
private com.badlogic.gdx.InputProcessor inputProcessor
public SplashScreen(com.badlogic.gdx.Game game)
game
- Variable storing the game's statepublic void show()
show
in interface com.badlogic.gdx.Screen
public void render(float delta)
render
in interface com.badlogic.gdx.Screen
delta
- 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