Class HudWidget<C extends HudWidgetConfig>

java.lang.Object
net.lynxclient.api.module.Module<C>
net.lynxclient.api.hud.HudWidget<C>
Direct Known Subclasses:
TextHudWidget

public abstract class HudWidget<C extends HudWidgetConfig> extends Module<C>
Something drawn on the HUD that the player can place in the HUD editor. Size and drawing are in GUI pixels at scale 1; LynxClient handles position, scale and background placement.
  • Field Details

    • NOT_CACHEABLE

      public static final long NOT_CACHEABLE
      Fingerprint of stateHash(): this widget changes every frame and cannot be cached
      See Also:
  • Constructor Details

    • HudWidget

      protected HudWidget(String id, C config)
  • Method Details

    • hasContent

      public boolean hasContent()
      false = nothing to show right now (no potion effects, no armour …) – skipped entirely in game, still shown in the editor
    • stateHash

      public long stateHash()
      Fingerprint of what the widget shows right now (values, pressed keys …). LynxClient may keep the drawn HUD and skip drawing while every fingerprint stays the same. Settings, position and size are covered by LynxClient. Default: NOT_CACHEABLE.
    • width

      public abstract int width(RenderContext ctx)
    • height

      public abstract int height(RenderContext ctx)
    • render

      public abstract void render(RenderContext ctx, boolean editor)
      Draw at (0, 0). editor = true in the HUD editor (show sample values even outside a world)