|
7 | 7 | import net.minecraft.client.gui.components.SpriteIconButton; |
8 | 8 | import net.minecraft.client.gui.layouts.GridLayout; |
9 | 9 | import net.minecraft.client.gui.layouts.Layout; |
| 10 | +import net.minecraft.client.renderer.RenderPipelines; |
10 | 11 | import net.minecraft.client.resources.language.I18n; |
11 | 12 | import net.minecraft.network.chat.Component; |
12 | 13 | import net.minecraft.resources.ResourceLocation; |
|
27 | 28 |
|
28 | 29 | public class ScanConfigureScreen extends GuiBase { |
29 | 30 | private static final ResourceLocation TRASH_ICON = XRay.assetLocation("gui/trash.png"); |
| 31 | + private static final ResourceLocation TRANSPARENT_BACKGROUND = XRay.assetLocation("gui/transparent_background.png"); |
30 | 32 |
|
31 | 33 | private EditBox oreName; |
32 | 34 |
|
@@ -183,8 +185,11 @@ public void tick() { |
183 | 185 | public void renderExtra(GuiGraphics graphics, int x, int y, float partialTicks) { |
184 | 186 | graphics.drawString(font, selectBlock.getName().getString(), getWidth() / 2 - 100, getHeight() / 2 - 90, 0xffffffff); |
185 | 187 |
|
| 188 | + // blit render the TRANSPARENT_BACKGROUND texture, a 16x16 checkerboard pattern that should tile to fit the fill area |
| 189 | + graphics.blit(RenderPipelines.GUI_TEXTURED, TRANSPARENT_BACKGROUND, this.getWidth() / 2 - 100, this.getHeight() / 2 - 45, 0, 0, 202, 24, 16, 16, 0x80FFFFFF); |
| 190 | + |
186 | 191 | int color = ((int) (this.alphaSlider.getValue() * 255) << 24) | ((int) (this.redSlider.getValue() * 255) << 16) | ((int) (this.greenSlider.getValue() * 255) << 8) | (int) (this.blueSlider.getValue() * 255); |
187 | | - graphics.fill(this.getWidth() / 2 - 100, this.getHeight() / 2 - 45, (this.getWidth() / 2 + 2) + 100, (this.getHeight() / 2 - 45) + 25, color); |
| 192 | + graphics.fill(this.getWidth() / 2 - 100, this.getHeight() / 2 - 45, (this.getWidth() / 2 + 2) + 100, (this.getHeight() / 2 - 45) + 24, color); |
188 | 193 |
|
189 | 194 | oreName.render(graphics, x, y, partialTicks); |
190 | 195 |
|
|
0 commit comments