aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java1
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/icon/TextureIcon.java2
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/icon/package-info.java14
3 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java
index 18da1e4..f65b513 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java
@@ -56,6 +56,7 @@ public class WButton extends WWidget {
*
* @param icon the icon
* @param label the label
+ * @since 2.2.0
*/
public WButton(Icon icon, StringRenderable label) {
this.icon = icon;
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/TextureIcon.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/TextureIcon.java
index e614e4b..0fec0fa 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/TextureIcon.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/TextureIcon.java
@@ -8,6 +8,8 @@ import net.minecraft.util.Identifier;
/**
* An icon that draws a texture.
+ *
+ * @since 2.2.0
*/
public class TextureIcon implements Icon {
private final Identifier texture;
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/package-info.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/package-info.java
new file mode 100644
index 0000000..54bbc92
--- /dev/null
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/package-info.java
@@ -0,0 +1,14 @@
+/**
+ * The icon API for displaying various icons on widgets.
+ *
+ * <p>For example, you can attach an icon to a button:
+ * <pre>
+ * {@code
+ * // This is a button with an apple item as the icon:
+ * WButton button = new WButton(new ItemIcon(new ItemStack(Items.APPLE)), new LiteralText("Apple button"));
+ * }
+ * </pre>
+ *
+ * @since 2.2.0
+ */
+package io.github.cottonmc.cotton.gui.widget.icon;