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 Summary
Static MethodsModifier and TypeMethodDescriptionstatic CottonHud.Positioner
horizontallyCentered
(int y) Creates a new positioner that centers widgets on the X axis and offsets them on the Y axis.static CottonHud.Positioner
of
(int x, int y) Creates a new positioner that offsets widgets.Methods inherited from interface io.github.cottonmc.cotton.gui.client.WidgetHudElement.Positioner
reposition
-
Method Details
-
of
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 offsety
- the y offset- Returns:
- an offsetting positioner
-
horizontallyCentered
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
-