aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/handlers/TextRenderer.java
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-08-08 23:07:53 -0400
committerbowser0000 <bowser0000@gmail.com>2020-08-08 23:07:53 -0400
commitfddf14fd04c50e02704c946d8893a3604f1abb11 (patch)
treea0dbf80dc346a460c865e97e79cd4ce15af361bf /src/main/java/me/Danker/handlers/TextRenderer.java
parent91aa2e90f5d802bb88b17f6a818e948823888e7b (diff)
downloadSkyblockMod-fddf14fd04c50e02704c946d8893a3604f1abb11.tar.gz
SkyblockMod-fddf14fd04c50e02704c946d8893a3604f1abb11.tar.bz2
SkyblockMod-fddf14fd04c50e02704c946d8893a3604f1abb11.zip
v1.6.1
Add all build files
Diffstat (limited to 'src/main/java/me/Danker/handlers/TextRenderer.java')
-rw-r--r--src/main/java/me/Danker/handlers/TextRenderer.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/handlers/TextRenderer.java b/src/main/java/me/Danker/handlers/TextRenderer.java
new file mode 100644
index 0000000..bf5711d
--- /dev/null
+++ b/src/main/java/me/Danker/handlers/TextRenderer.java
@@ -0,0 +1,20 @@
+package me.Danker.handlers;
+
+import org.lwjgl.opengl.GL11;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.Gui;
+
+public class TextRenderer extends Gui {
+ public TextRenderer(Minecraft mc, String text, int x, int y, double scale) {
+ double scaleReset = (double) Math.pow(scale, -1);
+
+ GL11.glScaled(scale, scale, scale);
+ y -= mc.fontRendererObj.FONT_HEIGHT;
+ for (String line : text.split("\n")) {
+ y += mc.fontRendererObj.FONT_HEIGHT * scale;
+ drawString(mc.fontRendererObj, line, (int) Math.round(x / scale), (int) Math.round(y / scale), 0xFFFFFF);
+ }
+ GL11.glScaled(scaleReset, scaleReset, scaleReset);
+ }
+}