aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/dulkirfabric/util/HudRenderUtil.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/util/HudRenderUtil.kt')
-rw-r--r--src/main/kotlin/com/dulkirfabric/util/HudRenderUtil.kt8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/util/HudRenderUtil.kt b/src/main/kotlin/com/dulkirfabric/util/HudRenderUtil.kt
index 40840d9..02b79f7 100644
--- a/src/main/kotlin/com/dulkirfabric/util/HudRenderUtil.kt
+++ b/src/main/kotlin/com/dulkirfabric/util/HudRenderUtil.kt
@@ -1,8 +1,6 @@
package com.dulkirfabric.util
import com.dulkirfabric.DulkirModFabric.mc
-import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext
-import net.minecraft.client.font.TextRenderer
import net.minecraft.client.gui.DrawContext
import net.minecraft.text.Text
@@ -11,11 +9,11 @@ object HudRenderUtil {
val matrices = context.matrices
val tr = mc.textRenderer
val w = tr.getWidth(content)
- val sf: Float = mc.window.scaledWidth / w.toFloat()
+ val sf: Float = mc.window.scaledWidth / w.toFloat() / 3
matrices.push()
- matrices.translate(mc.currentScreen!!.width / 3f, mc.window.scaledHeight / 2f,
- 0f)
+ matrices.translate(mc.window.scaledWidth / 3f, mc.window.scaledHeight / 2f, 0f)
matrices.scale(sf, sf, 1f)
context.drawText(tr, content, 0, -tr.fontHeight / 2, -1, true)
+ matrices.pop()
}
} \ No newline at end of file