Class TextHudElement

All Implemented Interfaces:
IHudElement, Globals, IRenderable2D, org.rusherhack.core.bind.IBindable, org.rusherhack.core.event.listener.EventListener, org.rusherhack.core.feature.IFeature, org.rusherhack.core.feature.IFeatureConfigurable, org.rusherhack.core.interfaces.IClickable, org.rusherhack.core.interfaces.IDraggable, org.rusherhack.core.interfaces.IHoverable, org.rusherhack.core.interfaces.INamed, org.rusherhack.core.interfaces.ITickable, org.rusherhack.core.interfaces.IToggleable, org.rusherhack.core.logging.ILoggable, org.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>, org.rusherhack.core.serialize.JsonSerializable

public abstract class TextHudElement extends HudElement
Basic hud element with text and a label
  • Field Details

    • PADDING

      public static final double PADDING
      Padding on each side of the text
      See Also:
  • Constructor Details

    • TextHudElement

      public TextHudElement(String name)
    • TextHudElement

      public TextHudElement(String name, boolean labeled)
  • Method Details

    • renderContent

      public void renderContent(RenderContext context, double mouseX, double mouseY)
      Description copied from interface: IHudElement
      Hud element is being called for rendering.

      Matrix is translated to the top left corner of the element before being called.

    • getLabel

      public String getLabel()
      Returns:
      the label of this hud element
    • getText

      public abstract String getText()
      Returns:
      the text to be displayed
    • getWidth

      public double getWidth()
      Specified by:
      getWidth in class ElementBase
    • getHeight

      public double getHeight()
      Specified by:
      getHeight in class ElementBase
    • shouldUpdateAlignment

      public boolean shouldUpdateAlignment()
      Overrides:
      shouldUpdateAlignment in class HudElement