diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/CottonHud.java | 12 | ||||
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WBar.java | 4 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonHud.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonHud.java index 255c8bd..8eb5f42 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonHud.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonHud.java @@ -33,6 +33,18 @@ public enum CottonHud implements HudRenderCallback { } /** + * Adds a new widget to the HUD at the specified offsets. + * + * @param widget the widget + * @param x the x offset + * @param y the y offset + * @see Positioner#of documentation about the offsets + */ + public void add(WWidget widget, int x, int y) { + add(widget, Positioner.of(x, y)); + } + + /** * Adds a new widget to the HUD with a custom positioner. * * @param widget the widget diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WBar.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WBar.java index d3bb769..ac6271d 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WBar.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WBar.java @@ -169,9 +169,11 @@ public class WBar extends WWidget { * {@link GuiDescription#getPropertyDelegate()} should be preferred over this if available. * * @param properties the properties + * @return this bar */ - public void setProperties(PropertyDelegate properties) { + public WBar setProperties(PropertyDelegate properties) { this.properties = properties; + return this; } /** |