Class CottonHud

java.lang.Object
io.github.cottonmc.cotton.gui.client.CottonHud

@Deprecated(forRemoval=true) @Environment(CLIENT) public final class CottonHud extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use HudElementRegistry with WidgetHudElement.
Manages widgets that are painted on the in-game HUD.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Deprecated, for removal: This API element is subject to removal in a future version.
    Positioners can be used to change the position of a widget based on the window dimensions.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    add(WWidget widget)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a new widget to the HUD.
    static void
    add(WWidget widget, int x, int y)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a new widget to the HUD at the specified offsets.
    static void
    add(WWidget widget, int x, int y, int width, int height)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a new widget to the HUD at the specified offsets and resizes it.
    static void
    add(WWidget widget, CottonHud.Positioner positioner)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a new widget to the HUD with a custom positioner.
    static void
    add(WWidget widget, CottonHud.Positioner positioner, int width, int height)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a new widget to the HUD with a custom positioner and resizes it.
    static void
    remove(WWidget widget)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes the widget from the HUD.
    static void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the positioner of the widget.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CottonHud

      public CottonHud()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • add

      public static void add(WWidget widget)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a new widget to the HUD.
      Parameters:
      widget - the widget
    • add

      public static void add(WWidget widget, int x, int y)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a new widget to the HUD at the specified offsets.
      Parameters:
      widget - the widget
      x - the x offset
      y - the y offset
      See Also:
    • add

      public static void add(WWidget widget, int x, int y, int width, int height)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a new widget to the HUD at the specified offsets and resizes it.
      Parameters:
      widget - the widget
      x - the x offset
      y - the y offset
      width - the width of the widget
      height - the height of the widget
      See Also:
    • add

      public static void add(WWidget widget, CottonHud.Positioner positioner)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a new widget to the HUD with a custom positioner.
      Parameters:
      widget - the widget
      positioner - the positioner
    • add

      public static void add(WWidget widget, CottonHud.Positioner positioner, int width, int height)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a new widget to the HUD with a custom positioner and resizes it.
      Parameters:
      widget - the widget
      positioner - the positioner
      width - the width of the widget
      height - the height of the widget
    • setPositioner

      public static void setPositioner(WWidget widget, CottonHud.Positioner positioner)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the positioner of the widget.
      Parameters:
      widget - the widget
      positioner - the positioner
    • remove

      public static void remove(WWidget widget)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes the widget from the HUD.
      Parameters:
      widget - the widget