@FunctionalInterface
public static interface CottonHud.Positioner
| Modifier and Type | Method and Description |
|---|---|
static 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.
|
void |
reposition(WWidget widget,
int hudWidth,
int hudHeight)
Repositions the widget according to the HUD dimensions.
|
void reposition(WWidget widget, int hudWidth, int hudHeight)
widget - the widgethudWidth - the width of the HUDhudHeight - the height of the HUDstatic CottonHud.Positioner of(int x, int y)
If an offset is negative, the offset is subtracted from the HUD dimension on that axis.
x - the x offsety - the y offsetstatic CottonHud.Positioner horizontallyCentered(int y)
If the Y offset is negative, the offset is subtracted from the HUD height.
y - the y offset