Package com.dragonboatrace.screens
Class MainMenuScreen
- java.lang.Object
-
- com.dragonboatrace.screens.MainMenuScreen
-
- All Implemented Interfaces:
com.badlogic.gdx.Screen
public class MainMenuScreen extends java.lang.Object implements com.badlogic.gdx.Screen
Represents the Main Menu where the game first starts.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Runnable[]
buttonActions
Array of functional interfaces that are invoked when each button is pressed.private Button[]
buttons
Array of buttons.protected DragonBoatRace
game
The instance of the game.private com.badlogic.gdx.graphics.Texture
logo
The texture of the main logo.private float
logoXOffset
The logo position X offset.private float
logoYOffset
The logo position Y offset.
-
Constructor Summary
Constructors Constructor Description MainMenuScreen(DragonBoatRace game)
Creates a new window that shows the main menu of the game.
-
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 main window.void
resize(int width, int height)
private void
restore()
Restores the game from the last save or notifies teh user if no such save exists.void
resume()
void
show()
-
-
-
Field Detail
-
game
protected final DragonBoatRace game
The instance of the game.
-
logoXOffset
private final float logoXOffset
The logo position X offset.
-
logoYOffset
private final float logoYOffset
The logo position Y offset.
-
logo
private final com.badlogic.gdx.graphics.Texture logo
The texture of the main logo.
-
buttonActions
private final java.lang.Runnable[] buttonActions
Array of functional interfaces that are invoked when each button is pressed.
-
buttons
private final Button[] buttons
Array of buttons.
-
-
Constructor Detail
-
MainMenuScreen
public MainMenuScreen(DragonBoatRace game)
Creates a new window that shows the main menu of the game.- Parameters:
game
- The instance of the game.
-
-
Method Detail
-
show
public void show()
- Specified by:
show
in interfacecom.badlogic.gdx.Screen
-
render
public void render(float delta)
Renders the main window.- 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
-
restore
private void restore()
Restores the game from the last save or notifies teh user if no such save exists. Invoked by a button
-
-