13 lines
563 B
Kotlin
13 lines
563 B
Kotlin
package fr.username404.snowygui.gui
|
|
|
|
import com.mojang.blaze3d.vertex.PoseStack
|
|
import net.minecraft.client.Minecraft
|
|
|
|
object FontUtil {
|
|
fun drawScaled(stack: PoseStack, text: String, x: Double, y: Double, scaleFactor: Float, color: Int = 0x000000) {
|
|
stack.scale(scaleFactor, scaleFactor, scaleFactor)
|
|
Minecraft.getInstance().font.draw(stack, text, (x / scaleFactor).toFloat(), (y / scaleFactor).toFloat(), color)
|
|
val factorToOriginal = 1F / scaleFactor
|
|
stack.scale(factorToOriginal, factorToOriginal, factorToOriginal)
|
|
}
|
|
} |