aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJuuz <6596629+Juuxel@users.noreply.github.com>2021-05-27 19:54:24 +0300
committerJuuz <6596629+Juuxel@users.noreply.github.com>2021-05-27 19:54:24 +0300
commitdc48a30a3205967bdc1bcdea33a155ee4a3ddc87 (patch)
treee85df0d74c1d9664aa6616a566f87e69d274bbe7 /src/main
parent935a2e13b4bf3a41c18d43e42fb14f1b726f5a3a (diff)
downloadLibGui-dc48a30a3205967bdc1bcdea33a155ee4a3ddc87.tar.gz
LibGui-dc48a30a3205967bdc1bcdea33a155ee4a3ddc87.tar.bz2
LibGui-dc48a30a3205967bdc1bcdea33a155ee4a3ddc87.zip
Improve BackgroundPainter javadoc about 9patch
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java b/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
index 113464c..47b106f 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java
@@ -16,6 +16,17 @@ import java.util.function.Consumer;
/**
* Background painters are used to paint the background of a widget.
* The background painter instance of a widget can be changed to customize the look of a widget.
+ *
+ * <h2>Nine-patch background painters</h2>
+ *
+ * Nine-patch background painters paint rectangles using a special nine-patch texture.
+ * The texture is divided into nine sections: four corners, four edges and a center part.
+ * The edges and the center are either tiled or stretched, depending on the mode of the painter,
+ * to fill the area between the corners. By default, the texture is tiled.
+ *
+ * <p>Nine-patch background painters are created using {@link #createNinePatch(Identifier)} or
+ * {@link #createNinePatch(Texture, Consumer)}. The latter lets you customise the look of
+ * the background more finely.
*/
@FunctionalInterface
public interface BackgroundPainter {
@@ -28,7 +39,7 @@ public interface BackgroundPainter {
public void paintBackground(MatrixStack matrices, int left, int top, WWidget panel);
/**
- * The {@code VANILLA} background painter draws a vanilla-like gui panel using {@linkplain NinePatch nine-patch textures}.
+ * The {@code VANILLA} background painter draws a vanilla-like GUI panel using nine-patch textures.
*
* <p>This background painter uses {@code libgui:textures/widget/panel_light.png} as the light texture and
* {@code libgui:textures/widget/panel_dark.png} as the dark texture.