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.ScreenDisplays the screen that shows how to play the game.
-
-
Field Summary
Fields Modifier and Type Field Description private ButtonbackButtonThe button used to go back to the main menu.private com.badlogic.gdx.graphics.g2d.SpriteBatchbatchThe spritebatch used to render the game.private intcurrPosThe current position of the help image in the window.private com.badlogic.gdx.graphics.TexturedownArrowScroll down indicator.private com.badlogic.gdx.graphics.g2d.BitmapFontfontThe font used to display the scroll indicator.private com.badlogic.gdx.graphics.TexturehelpInfoThe texture of the information about the game.private com.badlogic.gdx.graphics.g2d.GlyphLayoutlayoutGlyphLayout used for centering fontsprivate MainMenuScreenmainMenuThe instance of the main menu.private intmaxHeightThe maximum scroll height the help image can scroll to.private intminHeightThe minimum scroll height the help image can scroll to.private intpaddingPadding 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 voiddispose()voidhide()voidpause()voidrender(float delta)Renders the window used to show the help image.voidresize(int width, int height)voidresume()voidshow()
-
-
-
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:
showin interfacecom.badlogic.gdx.Screen
-
render
public void render(float delta)
Renders the window used to show the help image.- Specified by:
renderin interfacecom.badlogic.gdx.Screen- Parameters:
delta- The time passed since the last frame.
-
resize
public void resize(int width, int height)- Specified by:
resizein interfacecom.badlogic.gdx.Screen
-
pause
public void pause()
- Specified by:
pausein interfacecom.badlogic.gdx.Screen
-
resume
public void resume()
- Specified by:
resumein interfacecom.badlogic.gdx.Screen
-
hide
public void hide()
- Specified by:
hidein interfacecom.badlogic.gdx.Screen
-
dispose
public void dispose()
- Specified by:
disposein interfacecom.badlogic.gdx.Screen
-
-