@FunctionalInterface
public interface BackgroundPainter
| Modifier and Type | Field and Description |
|---|---|
static BackgroundPainter |
SLOT
The
SLOT background painter draws item slots or slot-like widgets. |
static BackgroundPainter |
VANILLA
The
VANILLA background painter draws a vanilla-like gui panel using nine-patch textures. |
| Modifier and Type | Method and Description |
|---|---|
static BackgroundPainter |
createColorful(int panelColor)
Creates a colorful gui panel painter.
|
static BackgroundPainter |
createColorful(int panelColor,
float contrast)
Creates a colorful gui panel painter that has a custom contrast between the shadows and highlights.
|
static BackgroundPainter |
createLightDarkVariants(BackgroundPainter light,
BackgroundPainter dark)
Creates a background painter that uses either the
light or the dark background painter
depending on the current setting. |
static NinePatch |
createNinePatch(net.minecraft.util.Identifier texture)
Creates a new nine-patch background painter.
|
static NinePatch |
createNinePatch(net.minecraft.util.Identifier texture,
int padding)
Creates a new nine-patch background painter with a custom padding.
|
void |
paintBackground(net.minecraft.client.util.math.MatrixStack matrices,
int left,
int top,
WWidget panel)
Paint the specified panel to the screen.
|
static final BackgroundPainter VANILLA
VANILLA background painter draws a vanilla-like gui panel using nine-patch textures.
This background painter uses libgui:textures/widget/panel_light.png as the light texture and
libgui:textures/widget/panel_dark.png as the dark texture.
This background painter is the default painter for root panels.
* You can override GuiDescription.addPainters() to customize the painter yourself.
static final BackgroundPainter SLOT
SLOT background painter draws item slots or slot-like widgets.void paintBackground(net.minecraft.client.util.math.MatrixStack matrices,
int left,
int top,
WWidget panel)
left - The absolute position of the left of the panel, in gui-screen coordinatestop - The absolute position of the top of the panel, in gui-screen coordinatespanel - The panel being paintedstatic BackgroundPainter createColorful(int panelColor)
panelColor - the panel background colorScreenDrawing.drawGuiPanel(MatrixStack, int, int, int, int, int)static BackgroundPainter createColorful(int panelColor, float contrast)
panelColor - the panel background colorcontrast - the contrast between the shadows and highlightsstatic NinePatch createNinePatch(net.minecraft.util.Identifier texture)
This method is equivalent to new NinePatch(texture).
texture - the background painter texturestatic NinePatch createNinePatch(net.minecraft.util.Identifier texture, int padding)
This method is equivalent to new NinePatch(texture).setPadding(padding).
texture - the background painter texturepadding - the padding of the painterstatic BackgroundPainter createLightDarkVariants(BackgroundPainter light, BackgroundPainter dark)
light or the dark background painter
depending on the current setting.light - the light mode background painterdark - the dark mode background painter