Class HungerBar

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

public class HungerBar extends UIComponent
  • Constructor Details

    • HungerBar

      public HungerBar()
  • 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 to be called when needed.
    • updateDisplay

      public void updateDisplay(int hungerLevel)
      Updates the display, showing the hunger 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 hunger 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. Releases all resources from this class.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent