Fix font rendering

Signed-off-by: Username404-59 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404-59 2024-05-25 17:53:15 +02:00
parent c204db0d47
commit c58eee6631
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 9 additions and 1 deletions

View File

@ -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
)
}
}
}
}