From c7543c833f9bf57c79f8f58c5c91beacb5d986f9 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sun, 9 May 2021 13:54:52 +0900 Subject: FIX TEXT FLASHING. BLEND GO BRRRRR --- src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java index e332a7b0..d30b82c9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MButton.java @@ -25,6 +25,9 @@ import lombok.Setter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; import java.awt.*; @@ -60,6 +63,9 @@ public class MButton extends MPanel { int x = (getBounds().width - width) / 2; int y = (getBounds().height - renderer.FONT_HEIGHT) / 2 + 1; + GlStateManager.enableBlend(); + GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); renderer.drawString(getText(), x,y, foreground.getRGB()); } -- cgit