Class VanillaHUDElement

java.lang.Object
me.hackware.api.hud.HUDElement
me.hackware.api.hud.VanillaHUDElement
All Implemented Interfaces:
SettingContainer

public abstract class VanillaHUDElement extends HUDElement
Base for phantom elements that proxy vanilla (or third-party) HUD clusters — hotbar, boss bar, Xaero minimap. They only position/scale rendering that happens elsewhere: draggable in the editor, offset the real renderer in-world.
  • Constructor Details

    • VanillaHUDElement

      protected VanillaHUDElement(String id, int defaultX, int defaultY, HUDElement.Anchor anchor)
  • Method Details

    • scalesWithTextScale

      public boolean scalesWithTextScale()
      Description copied from class: HUDElement
      Whether this element scales with the global HUD text scale. Text-based elements return true; graphical elements (hotbar, item, icons, bars, models, maps) override this to false so the text scale only affects text and they keep their own per-element scale.
      Overrides:
      scalesWithTextScale in class HUDElement
    • wrapperScale

      public float wrapperScale()
      Description copied from class: HUDElement
      Scale to pass to the shared HUDElement.render(net.minecraft.client.gui.GuiGraphics, net.minecraft.client.gui.Font) wrapper. Most graphical elements scale fully through the wrapper, so this returns HUDElement.graphicalScale() (per-element scale × base HUD scale). Elements that apply their per-element scale internally (item, armor, hotbar, boss bar, minimap) override this — to HudServices.getTextScale() when the wrapper should still apply the base scale on top of their internal per-element scale, or 1.0 when they apply the full scale themselves.
      Overrides:
      wrapperScale in class HUDElement
    • getExpandAnchorX

      public HUDElement.ExpandAnchorX getExpandAnchorX()
      Overrides:
      getExpandAnchorX in class HUDElement
    • getExpandAnchorY

      public HUDElement.ExpandAnchorY getExpandAnchorY()
      Overrides:
      getExpandAnchorY in class HUDElement
    • canResetToDefault

      public boolean canResetToDefault()
      Description copied from class: HUDElement
      Whether this element supports the "Reset to default" context-menu action. Subclasses that have a meaningful default position (e.g. built-in HUD elements anchored to vanilla positions) should override and return true.
      Overrides:
      canResetToDefault in class HUDElement
    • clamp

      public void clamp(int screenWidth, int screenHeight)
      Description copied from class: HUDElement
      Clamp position to screen bounds, respecting screen margin and per-side flags.
      Overrides:
      clamp in class HUDElement