diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-16 18:51:04 +0300 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-16 18:51:04 +0300 |
commit | 319b74a2fb12126dd1906a389fa8c48af0af8d40 (patch) | |
tree | 2441cfd4d1630a615bba53e9b73922aab886e25e /src/main | |
parent | 66e331452061d1d102a6db055b7da4638335b06f (diff) | |
download | LibGui-319b74a2fb12126dd1906a389fa8c48af0af8d40.tar.gz LibGui-319b74a2fb12126dd1906a389fa8c48af0af8d40.tar.bz2 LibGui-319b74a2fb12126dd1906a389fa8c48af0af8d40.zip |
Rename BackgroundPainter.VANILLA_9PATCH to VANILLA, make it the default
Also added FunctionalInterface to BackgroundPainter.
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/BackgroundPainter.java | 21 |
1 files changed, 6 insertions, 15 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 70d8ba4..6badb54 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 @@ -8,6 +8,7 @@ import net.minecraft.util.Identifier; * 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. */ +@FunctionalInterface public interface BackgroundPainter { /** * Paint the specified panel to the screen. @@ -17,30 +18,20 @@ public interface BackgroundPainter { */ public void paintBackground(int left, int top, WWidget panel); - /** - * The {@code VANILLA} background painter draws a vanilla-like gui panel using {@link ScreenDrawing#drawGuiPanel(int, int, int, int)}. - * - * <p>This background painter applies a padding of 8 pixels to all sides around the widget. - * - * <p>This background painter is the default painter for root panels. - * * You can override {@link io.github.cottonmc.cotton.gui.GuiDescription#addPainters()} to customize the painter yourself. - */ - public static BackgroundPainter VANILLA = (left, top, panel) -> { - ScreenDrawing.drawGuiPanel(left-8, top-8, panel.getWidth()+16, panel.getHeight()+16); - }; - - /** - * The {@code VANILLA_9PATCH} 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 {@linkplain NinePatch 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. * * <p>This background painter applies a padding of 8 pixels to all sides around the widget. * + * <p>This background painter is the default painter for root panels. + * * You can override {@link io.github.cottonmc.cotton.gui.GuiDescription#addPainters()} to customize the painter yourself. + * * @since 1.5.0 */ - public static BackgroundPainter VANILLA_9PATCH = createLightDarkVariants( + public static BackgroundPainter VANILLA = createLightDarkVariants( createNinePatch(new Identifier("libgui", "textures/widget/panel_light.png"), 8), createNinePatch(new Identifier("libgui", "textures/widget/panel_dark.png"), 8) ); |