Java Code Examples for com.mojang.blaze3d.platform.GlStateManager#enableAlphaTest()
The following examples show how to use
com.mojang.blaze3d.platform.GlStateManager#enableAlphaTest() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DownloadScreen.java From Sandbox with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void render(int mouseX, int mouseY, float partialTicks) { super.render(mouseX, mouseY, partialTicks); String right = "Preparing Addon " + addon + " of " + dls.length; String right2 = ""; if (dl.hasStarted()) { right = "Downloading Addon " + addon + " of " + dls.length; int percent = (int) ((dl.getCurrentSize() * 100) / dl.getTotalSize()); right2 = percent + "% " + humanReadableByteCount(dl.getCurrentSize()) + "/" + humanReadableByteCount(dl.getTotalSize()); } if (dl.isComplete()) { right = "Completed Addon Download " + addon + " of " + dls.length; nextAddon(); } fill(0, 0, width, height, RED.getRGB()); fill(0, height - 20, width, height, DARK.darker().getRGB()); fill(width - font.getStringWidth(right) - 4, height - 34, width, height, DARK.darker().getRGB()); GlStateManager.pushMatrix(); GlStateManager.enableBlend(); GlStateManager.enableAlphaTest(); minecraft.getTextureManager().bindTexture(new Identifier("sandbox", "textures/gui/sandbox.png")); GlStateManager.color4f(1, 1, 1, 1); int int_6 = (this.minecraft.getWindow().getScaledWidth() - 256) / 2; int int_8 = (this.minecraft.getWindow().getScaledHeight() - 256) / 2; this.blit(int_6, int_8, 0, 0, 256, 256); GlStateManager.popMatrix(); drawCenteredString(font, "Connecting to Sandbox", (int) (width / 2f), (int) ((height / 2f) + (width / 3) / 2) - 20, WHITE.getRGB()); drawRightText(right, width, height - 30, WHITE.getRGB()); drawCenteredString(font, right2, width - (font.getStringWidth(right) / 2), height - 14, WHITE.getRGB()); font.drawWithShadow("Joining Private Session", 3, height - 14, WHITE.getRGB()); }
Example 2
Source File: LoadingOverlay.java From Sandbox with GNU Lesser General Public License v3.0 | 4 votes |
@Override public void render(int mouseX, int mouseY, float partialTicks) { int width = this.client.getWindow().getScaledWidth(); int height = this.client.getWindow().getScaledHeight(); String right = "Preparing Addon " + addon + " of " + addons.size(); String right2 = ""; if (dl == null) { nextAddon(); } if (dl != null) { if (dl.hasStarted()) { right = "Downloading Addon " + addon + " of " + addons.size(); int percent = (int) ((dl.getCurrentSize() * 100) / dl.getTotalSize()); right2 = percent + "% " + humanReadableByteCount(dl.getCurrentSize()) + "/" + humanReadableByteCount(dl.getTotalSize()); } if (dl.isComplete()) { right = "Completed Addon Download " + addon + " of " + addons.size(); nextAddon(); } } if (addon >= addons.size()) { client.setOverlay(null); SandboxClient.INSTANCE.load(addons.stream().map(addon -> Paths.get("server/cache/" + addon.getRight())).collect(Collectors.toList())); } fill(0, 0, width, height, RED.getRGB()); fill(0, height - 20, width, height, DARK.darker().getRGB()); fill(width - client.textRenderer.getStringWidth(right) - 4, height - 34, width, height, DARK.darker().getRGB()); GlStateManager.pushMatrix(); GlStateManager.enableBlend(); GlStateManager.enableAlphaTest(); client.getTextureManager().bindTexture(new Identifier("sandbox", "textures/gui/sandbox.png")); GlStateManager.color4f(1, 1, 1, 1); int int_6 = (this.client.getWindow().getScaledWidth() - 256) / 2; int int_8 = (this.client.getWindow().getScaledHeight() - 256) / 2; this.blit(int_6, int_8, 0, 0, 256, 256); GlStateManager.popMatrix(); drawCenteredString(client.textRenderer, "Connecting to Sandbox", (int) (width / 2f), (int) ((height / 2f) + (width / 3) / 2) - 20, WHITE.getRGB()); drawRightText(right, width, height - 30, WHITE.getRGB()); drawCenteredString(client.textRenderer, right2, width - (client.textRenderer.getStringWidth(right) / 2), height - 14, WHITE.getRGB()); client.textRenderer.drawWithShadow("Joining Private Session", 3, height - 14, WHITE.getRGB()); }
Example 3
Source File: RenderHelper.java From BoundingBoxOutlineReloaded with MIT License | 4 votes |
public static void enableAlphaTest() { GlStateManager.enableAlphaTest(); }