Package com.dragonboatrace.screens
Class HelpScreen
- java.lang.Object
-
- com.dragonboatrace.screens.HelpScreen
-
- All Implemented Interfaces:
com.badlogic.gdx.Screen
public class HelpScreen extends java.lang.Object implements com.badlogic.gdx.Screen
Displays the screen that shows how to play the game.
-
-
Field Summary
Fields Modifier and Type Field Description private Button
backButton
The button used to go back to the main menu.private com.badlogic.gdx.graphics.g2d.SpriteBatch
batch
The spritebatch used to render the game.private int
currPos
The current position of the help image in the window.private com.badlogic.gdx.graphics.Texture
downArrow
Scroll down indicator.private com.badlogic.gdx.graphics.g2d.BitmapFont
font
The font used to display the scroll indicator.private com.badlogic.gdx.graphics.Texture
helpInfo
The texture of the information about the game.private com.badlogic.gdx.graphics.g2d.GlyphLayout
layout
GlyphLayout used for centering fontsprivate MainMenuScreen
mainMenu
The instance of the main menu.private int
maxHeight
The maximum scroll height the help image can scroll to.private int
minHeight
The minimum scroll height the help image can scroll to.private int
padding
Padding around the help image.
-
Constructor Summary
Constructors Constructor Description HelpScreen(MainMenuScreen callBack)
Creates a new window to display the help info in.
-
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 window used to show the help image.void
resize(int width, int height)
void
resume()
void
show()
-
-
-
Field Detail
-
mainMenu
private final MainMenuScreen mainMenu
The instance of the main menu.
-
helpInfo
private final com.badlogic.gdx.graphics.Texture helpInfo
The texture of the information about the game.
-
batch
private final com.badlogic.gdx.graphics.g2d.SpriteBatch batch
The spritebatch used to render the game.
-
backButton
private final Button backButton
The button used to go back to the main menu.
-
maxHeight
private final int maxHeight
The maximum scroll height the help image can scroll to.
-
minHeight
private final int minHeight
The minimum scroll height the help image can scroll to.
-
padding
private final int padding
Padding around the help image.
-
currPos
private int currPos
The current position of the help image in the window.
-
downArrow
private final com.badlogic.gdx.graphics.Texture downArrow
Scroll down indicator.
-
layout
private final com.badlogic.gdx.graphics.g2d.GlyphLayout layout
GlyphLayout used for centering fonts
-
font
private final com.badlogic.gdx.graphics.g2d.BitmapFont font
The font used to display the scroll indicator.
-
-
Constructor Detail
-
HelpScreen
public HelpScreen(MainMenuScreen callBack)
Creates a new window to display the help info in.- Parameters:
callBack
- A reference to the main menu window so we can return using the back button.
-
-
Method Detail
-
show
public void show()
- Specified by:
show
in interfacecom.badlogic.gdx.Screen
-
render
public void render(float delta)
Renders the window used to show the help image.- 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
-
-