Enum Class CottonHud
- All Implemented Interfaces:
Serializable,Comparable<CottonHud>,Constable,net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback
@Environment(CLIENT)
public enum CottonHud
extends Enum<CottonHud>
implements net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback
Manages widgets that are painted on the in-game HUD.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacePositioners can be used to change the position of a widget based on the window dimensions.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields inherited from interface net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback
EVENT -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new widget to the HUD.voidAdds a new widget to the HUD at the specified offsets.voidAdds a new widget to the HUD at the specified offsets and resizes it.voidadd(WWidget widget, CottonHud.Positioner positioner)Adds a new widget to the HUD with a custom positioner.voidadd(WWidget widget, CottonHud.Positioner positioner, int width, int height)Adds a new widget to the HUD with a custom positioner and resizes it.voidonHudRender(net.minecraft.client.util.math.MatrixStack matrices, float tickDelta)voidRemoves the widget from the HUD.voidsetPositioner(WWidget widget, CottonHud.Positioner positioner)Sets the positioner of the widget.static CottonHudReturns the enum constant of this class with the specified name.static CottonHud[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
add
Adds a new widget to the HUD.- Parameters:
widget- the widget
-
add
Adds a new widget to the HUD at the specified offsets.- Parameters:
widget- the widgetx- the x offsety- the y offset- See Also:
documentation about the offsets
-
add
Adds a new widget to the HUD at the specified offsets and resizes it.- Parameters:
widget- the widgetx- the x offsety- the y offsetwidth- the width of the widgetheight- the height of the widget- See Also:
documentation about the offsets
-
add
Adds a new widget to the HUD with a custom positioner.- Parameters:
widget- the widgetpositioner- the positioner
-
add
Adds a new widget to the HUD with a custom positioner and resizes it.- Parameters:
widget- the widgetpositioner- the positionerwidth- the width of the widgetheight- the height of the widget
-
setPositioner
Sets the positioner of the widget.- Parameters:
widget- the widgetpositioner- the positioner
-
remove
Removes the widget from the HUD.- Parameters:
widget- the widget
-
onHudRender
public void onHudRender(net.minecraft.client.util.math.MatrixStack matrices, float tickDelta)- Specified by:
onHudRenderin interfacenet.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback
-