@Environment(value=CLIENT) public enum CottonHud extends java.lang.Enum<CottonHud> implements net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback
| Modifier and Type | Class and Description |
|---|---|
static interface |
CottonHud.Positioner
Positioners can be used to change the position of a widget based on the window dimensions.
|
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
void |
add(WWidget widget)
Adds a new widget to the HUD.
|
void |
add(WWidget widget,
CottonHud.Positioner positioner)
Adds a new widget to the HUD with a custom positioner.
|
void |
add(WWidget widget,
CottonHud.Positioner positioner,
int width,
int height)
Adds a new widget to the HUD with a custom positioner and resizes it.
|
void |
add(WWidget widget,
int x,
int y)
Adds a new widget to the HUD at the specified offsets.
|
void |
add(WWidget widget,
int x,
int y,
int width,
int height)
Adds a new widget to the HUD at the specified offsets and resizes it.
|
void |
onHudRender(net.minecraft.client.util.math.MatrixStack matrices,
float tickDelta) |
void |
remove(WWidget widget)
Removes the widget from the HUD.
|
void |
setPositioner(WWidget widget,
CottonHud.Positioner positioner)
Sets the positioner of the widget.
|
static CottonHud |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static CottonHud[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CottonHud INSTANCE
public static CottonHud[] values()
for (CottonHud c : CottonHud.values()) System.out.println(c);
public static CottonHud valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic void add(WWidget widget)
widget - the widgetpublic void add(WWidget widget, int x, int y)
widget - the widgetx - the x offsety - the y offsetdocumentation about the offsetspublic void add(WWidget widget, int x, int y, int width, int height)
widget - the widgetx - the x offsety - the y offsetwidth - the width of the widgetheight - the height of the widgetdocumentation about the offsetspublic void add(WWidget widget, CottonHud.Positioner positioner)
widget - the widgetpositioner - the positionerpublic void add(WWidget widget, CottonHud.Positioner positioner, int width, int height)
widget - the widgetpositioner - the positionerwidth - the width of the widgetheight - the height of the widgetpublic void setPositioner(WWidget widget, CottonHud.Positioner positioner)
widget - the widgetpositioner - the positionerpublic void remove(WWidget widget)
widget - the widgetpublic void onHudRender(net.minecraft.client.util.math.MatrixStack matrices,
float tickDelta)
onHudRender in interface net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback