Class OxygenDisplay

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, com.badlogic.gdx.utils.Json.Serializable, Renderable, Comparable<Renderable>

public class OxygenDisplay extends UIComponent
A UI component for displaying the current oxygen level on the Main Game Screen.
  • Constructor Details

    • OxygenDisplay

      public OxygenDisplay()
  • Method Details

    • create

      public void create()
      Creates reusable ui styles and adds actors to the stage.
      Overrides:
      create in class UIComponent
    • createTexture

      public void createTexture()
      Initialises all the possible images and labels that will be used by the class, and stores them in an array.
    • updateDisplay

      public void updateDisplay()
      Updates the display, showing the oxygen bar in the top of the main game screen.
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Draws the table and group onto the main game screen. Adds the oxygen elements onto the stage.
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - Batch to render to.
    • dispose

      public void dispose()
      Removes all entities from the screen and releases all resources from this class.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent