Class AddonHudModule

java.lang.Object
dev.boze.api.addon.AddonModule
dev.boze.api.addon.AddonHudModule
All Implemented Interfaces:
BaseModule, Serializable<AddonModule>

public abstract class AddonHudModule extends AddonModule
Base class for addon HUD modules.
A HUD module supplies its content as a list of HudLines (each a row of colored HudText segments). Boze renders the lines as a draggable HUD element in the Hud category, so addons don't deal with positioning or text layout themselves - just return what to show. getLines() is called every frame while the module is enabled.
  • Constructor Details

    • AddonHudModule

      protected AddonHudModule(String name, String description)
      Creates a new HUD module.
      Parameters:
      name - Internal name of this module
      description - Description of what this module shows
  • Method Details

    • getLines

      public abstract List<HudLine> getLines()
      Supplies the lines to render, top to bottom. Called every frame while enabled.
      Returns:
      the HUD lines to draw
    • sortByLength

      public boolean sortByLength()
      Whether Boze should sort the lines by rendered length, like the ArrayList HUD: longest line toward the nearest top/bottom screen edge. Override to return true; defaults to false.
      Returns:
      true to sort lines by length