Class CottonHud
java.lang.Object
io.github.cottonmc.cotton.gui.client.CottonHud
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. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdds a new widget to the HUD.static voidAdds a new widget to the HUD at the specified offsets.static voidAdds a new widget to the HUD at the specified offsets and resizes it.static voidadd(WWidget widget, CottonHud.Positioner positioner) Adds a new widget to the HUD with a custom positioner.static voidadd(WWidget widget, CottonHud.Positioner positioner, int width, int height) Adds a new widget to the HUD with a custom positioner and resizes it.static voidRemoves the widget from the HUD.static voidsetPositioner(WWidget widget, CottonHud.Positioner positioner) Sets the positioner of the widget.
-
Constructor Details
-
CottonHud
public CottonHud()
-
-
Method Details
-
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:
-
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:
-
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
-