diff options
-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) ); |