Class BoatSelectScreen

  • All Implemented Interfaces:
    com.badlogic.gdx.Screen

    public class BoatSelectScreen
    extends java.lang.Object
    implements com.badlogic.gdx.Screen
    Displays the screen that allows the player to choose a boat at the beginning of the game.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Button[] buttons
      Array storing all buttons (each button keeps track of its own texture)
      private int buttonWidth  
      private com.badlogic.gdx.graphics.g2d.BitmapFont font  
      private DragonBoatRace game
      Instance of the main game, used to have a collective spritebatch which gives better performance.
      private com.badlogic.gdx.graphics.Texture[] iconTextures
      Array storing all boat textures
      private com.badlogic.gdx.graphics.g2d.GlyphLayout layout  
      private java.lang.String[] textureNames
      Array storing all texture names (they will later be combined with .png and _button)
      private java.lang.String title  
    • Constructor Summary

      Constructors 
      Constructor Description
      BoatSelectScreen​(DragonBoatRace game)
      Creates a new screen to display the boat options to the player.
    • 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 boat selection screen.
      void resize​(int width, int height)  
      void resume()  
      void show()  
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • textureNames

        private final java.lang.String[] textureNames
        Array storing all texture names (they will later be combined with .png and _button)
      • iconTextures

        private final com.badlogic.gdx.graphics.Texture[] iconTextures
        Array storing all boat textures
      • buttons

        private final Button[] buttons
        Array storing all buttons (each button keeps track of its own texture)
      • game

        private final DragonBoatRace game
        Instance of the main game, used to have a collective spritebatch which gives better performance.
      • font

        private final com.badlogic.gdx.graphics.g2d.BitmapFont font
      • layout

        private final com.badlogic.gdx.graphics.g2d.GlyphLayout layout
      • buttonWidth

        private final int buttonWidth
    • Constructor Detail

      • BoatSelectScreen

        public BoatSelectScreen​(DragonBoatRace game)
        Creates a new screen to display the boat options to the player.
        Parameters:
        game - The instance of the DragonBoatRace game.
    • Method Detail

      • show

        public void show()
        Specified by:
        show in interface com.badlogic.gdx.Screen
      • render

        public void render​(float delta)
        Renders the boat selection screen.
        Specified by:
        render in interface com.badlogic.gdx.Screen
        Parameters:
        delta - The time passed since the last frame.
      • resize

        public void resize​(int width,
                           int height)
        Specified by:
        resize in interface com.badlogic.gdx.Screen
      • pause

        public void pause()
        Specified by:
        pause in interface com.badlogic.gdx.Screen
      • resume

        public void resume()
        Specified by:
        resume in interface com.badlogic.gdx.Screen
      • hide

        public void hide()
        Specified by:
        hide in interface com.badlogic.gdx.Screen
      • dispose

        public void dispose()
        Specified by:
        dispose in interface com.badlogic.gdx.Screen