Class Page

  • All Implemented Interfaces:
    com.badlogic.gdx.Screen
    Direct Known Subclasses:
    DifficultyScreen, EndScreen, GameScreen, MenuScreen, PauseScreen

    public abstract class Page
    extends com.badlogic.gdx.ScreenAdapter
    Base class for UI screens. Contains and draws UI actors added in subclasses.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.ArrayList<com.badlogic.gdx.scenes.scene2d.Actor> actors  
    • Constructor Summary

      Constructors 
      Constructor Description
      Page​(PirateGame parent)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void CreateActors()  
      void hide()
      Called once the page is hidden.
      void render​(float delta)
      draws the stage and acts upon it also calls update
      void resize​(int width, int height)
      Called once the window is resized updates constants and stage
      void show()
      Called once the page is show sets input handler and adds actors
      protected void update()
      Called once per frame
      • Methods inherited from class com.badlogic.gdx.ScreenAdapter

        dispose, pause, resume
      • Methods inherited from class java.lang.Object

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

      • actors

        protected java.util.ArrayList<com.badlogic.gdx.scenes.scene2d.Actor> actors
    • Constructor Detail

    • Method Detail

      • CreateActors

        protected abstract void CreateActors()
      • show

        public void show()
        Called once the page is show sets input handler and adds actors
        Specified by:
        show in interface com.badlogic.gdx.Screen
        Overrides:
        show in class com.badlogic.gdx.ScreenAdapter
      • render

        public void render​(float delta)
        draws the stage and acts upon it also calls update
        Specified by:
        render in interface com.badlogic.gdx.Screen
        Overrides:
        render in class com.badlogic.gdx.ScreenAdapter
        Parameters:
        delta - delta time
      • hide

        public void hide()
        Called once the page is hidden. sets input handler to null and clears teh stage
        Specified by:
        hide in interface com.badlogic.gdx.Screen
        Overrides:
        hide in class com.badlogic.gdx.ScreenAdapter
      • resize

        public void resize​(int width,
                           int height)
        Called once the window is resized updates constants and stage
        Specified by:
        resize in interface com.badlogic.gdx.Screen
        Overrides:
        resize in class com.badlogic.gdx.ScreenAdapter
        Parameters:
        width - new dim x
        height - new dom y
      • update

        protected void update()
        Called once per frame