From c58eee66319e470d7ee0cf7d77a360ad5666c87f Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Sat, 25 May 2024 17:53:15 +0200 Subject: [PATCH] Fix font rendering Signed-off-by: Username404-59 --- .../fr/username404/snowygui/gui/elements/ClickBox.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickBox.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickBox.kt index 6d8b449..eaa2803 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickBox.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickBox.kt @@ -15,6 +15,7 @@ import fr.username404.snowygui.utils.RenderingUtil.prepareDraw import fr.username404.snowygui.utils.RenderingUtil.tessellator import io.github.config4k.extract import net.minecraft.client.Minecraft +import net.minecraft.client.gui.Font import net.minecraft.client.gui.GuiGraphics import net.minecraft.network.chat.Component import org.jetbrains.annotations.ApiStatus @@ -115,6 +116,13 @@ class ClickBox( }.display(guiGraphics) } } - guiGraphics?.drawString(Minecraft.getInstance().font, name.string, (x + 5).toInt(), (y + 2).toInt(), Colors.TRANSPARENT.hexValue, false) + guiGraphics?.run { + with(Minecraft.getInstance().font) { + drawInBatch(name.string, + (x + 5).toFloat(), (y + 2).toFloat(), Colors.TRANSPARENT.hexValue, false, + pose().last().pose(), bufferSource(), Font.DisplayMode.NORMAL, 0, 15728880, isBidirectional + ) + } + } } }