Package controller

Class HUDController

All Implemented Interfaces:
Serializable, Cloneable, Iterable<HUDElement>, Collection<HUDElement>, Set<HUDElement>

public class HUDController extends AbstractController<HUDElement>
See Also:
  • Constructor Details

    • HUDController

      public HUDController(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Keeps a set of HUD elements and makes sure they are drawn.
      Parameters:
      batch - the batch for the HUD
  • Method Details

    • update

      public void update()
      Redraws the HUD and all HUD elements.
      Specified by:
      update in class AbstractController<HUDElement>
    • drawText

      public com.badlogic.gdx.scenes.scene2d.ui.Label drawText(String text, String fontPath, com.badlogic.gdx.graphics.Color color, int size, int width, int height, int x, int y, int borderWidth)
      Draws a given text on the screen.
      Parameters:
      text - text to draw
      fontPath - path to the font
      color - color to use
      size - font size to use
      width - width of the text box
      height - height of the text box
      x - x-position in pixel
      y - y-position in pixel
      borderWidth - borderWidth for the text
      Returns:
      Label (use this to alter text or remove the text later)
    • drawText

      public com.badlogic.gdx.scenes.scene2d.ui.Label drawText(String text, String fontPath, com.badlogic.gdx.graphics.Color color, int size, int width, int height, int x, int y)
      Draws a given text on the screen.
      Parameters:
      text - text to draw
      fontPath - path to the font
      color - color to use
      size - font size to use
      width - width of the text box
      height - height of the text box
      x - x-position in pixel
      y - y-position in pixel
      Returns:
      Label (use this to alter text or remove the text later)