Class Overlay

  • All Implemented Interfaces:
    Drawable, com.badlogic.gdx.utils.Disposable
    Direct Known Subclasses:
    GameOverMenu, HeadsUpDisplay, PauseMenu

    public abstract class Overlay
    extends java.lang.Object
    implements Drawable
    An Overlay denotes a distinctly Drawable scene, typically rendered on top of a Screen
    Author:
    ENG1 Team 23 (Cohort 3)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static int GENERAL_FORM_PADDING
      The standard level of padding, specified in pixels, to be used for form Actor elements being used in extensions of the Overlay
      private com.badlogic.gdx.scenes.scene2d.Stage stage
      The LibGDX Stage used for rendering Actor elements onto the visible Overlay
    • Constructor Summary

      Constructors 
      Constructor Description
      Overlay​(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Creates a new Overlay relating to the given SpriteBatch
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void addActor​(com.badlogic.gdx.scenes.scene2d.Actor actor)
      Adds an Actor to the Overlay
      void dispose()
      Releases all resources used by the Overlay
      void render​(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Renders the current Overlay to the given SpriteBatch
      • Methods inherited from class java.lang.Object

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

      • GENERAL_FORM_PADDING

        static final int GENERAL_FORM_PADDING
        The standard level of padding, specified in pixels, to be used for form Actor elements being used in extensions of the Overlay
        See Also:
        Constant Field Values
    • Constructor Detail

      • Overlay

        Overlay​(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
        Creates a new Overlay relating to the given SpriteBatch
        Parameters:
        batch - The SpriteBatch to which the Overlay should be connected
    • Method Detail

      • addActor

        void addActor​(com.badlogic.gdx.scenes.scene2d.Actor actor)
        Adds an Actor to the Overlay
        Parameters:
        actor - The element to add to the Stage
        See Also:
        Actor
      • dispose

        public void dispose()
        Releases all resources used by the Overlay
        Specified by:
        dispose in interface com.badlogic.gdx.utils.Disposable
      • render

        public void render​(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
        Renders the current Overlay to the given SpriteBatch
        Specified by:
        render in interface Drawable
        Parameters:
        batch - Target of the rendering operation