mirror of
https://github.com/xiaozhou233/OrangeX-Client.git
synced 2026-12-05 21:15:53 +08:00
feat: add font scaling and render OrangeX HUD text
This commit is contained in:
1 parent
b3e7000bf0
commit
22be63c5ac
3 files changed
+8
-6
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package cn.xiaozhou233.orangex.font;
|
||||
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.texture.AbstractTexture;
|
||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||
@@ -173,7 +174,12 @@ public class CFont
|
||||
|
||||
public int getHeight()
|
||||
{
|
||||
return (this.fontHeight - 8) / 2;
|
||||
return (int) (((this.fontHeight - 8) / 2) * getFontScale());
|
||||
}
|
||||
|
||||
protected double getFontScale()
|
||||
{
|
||||
return (Minecraft.getMinecraft().displayWidth / 1920.0D) * 0.5D;
|
||||
}
|
||||
|
||||
public int getStringWidth(String text)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package cn.xiaozhou233.orangex.font;
|
||||
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.texture.AbstractTexture;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -479,10 +478,6 @@ public class FontRenderer extends CFont {
|
||||
return finalWords;
|
||||
}
|
||||
|
||||
private double getFontScale() {
|
||||
return (Minecraft.getMinecraft().displayWidth / 1920.0D) * 0.5D;
|
||||
}
|
||||
|
||||
private void setupMinecraftColorcodes() {
|
||||
for (int index = 0; index < 32; index++) {
|
||||
int noClue = (index >> 3 & 0x1) * 85;
|
||||
|
||||
@@ -34,6 +34,7 @@ public class MixinGuiIngame {
|
||||
mc.entityRenderer.setupOverlayRendering();
|
||||
|
||||
OrangeX.getInstance().getEventBus().post(new EventRender2D(partialTicks));
|
||||
OrangeX.getInstance().getFontManager().JelloMedium32.drawString("OrangeX", 10, 10, 0xFFA500);
|
||||
|
||||
GlStateManager.enableDepth();
|
||||
GlStateManager.disableBlend();
|
||||
|
||||
Reference in new issue
Block a user