Class 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()  
      • Methods inherited from class java.lang.Object

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

      • 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 interface com.badlogic.gdx.Screen
      • render

        public void render​(float delta)
        Renders the main window.
        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
      • restore

        private void restore()
        Restores the game from the last save or notifies teh user if no such save exists. Invoked by a button