Interface CottonHud.Positioner

All Superinterfaces:
WidgetHudElement.Positioner
Enclosing class:
CottonHud
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface CottonHud.Positioner extends WidgetHudElement.Positioner
Positioners can be used to change the position of a widget based on the window dimensions.
  • Method Details

    • of

      static CottonHud.Positioner of(int x, int y)
      Creates a new positioner that offsets widgets.

      If an offset is negative, the offset is subtracted from the HUD dimension on that axis.

      Parameters:
      x - the x offset
      y - the y offset
      Returns:
      an offsetting positioner
    • horizontallyCentered

      static CottonHud.Positioner horizontallyCentered(int y)
      Creates a new positioner that centers widgets on the X axis and offsets them on the Y axis.

      If the Y offset is negative, the offset is subtracted from the HUD height.

      Parameters:
      y - the y offset
      Returns:
      a centering positioner