修改HUD渲染坐标

This commit is contained in:
17146 2024-05-18 23:50:46 +08:00
parent 1fc00c21f7
commit b5de7df1ec

View file

@ -101,8 +101,8 @@ public class AmmoBarOverlay {
event.getGuiGraphics().drawString( event.getGuiGraphics().drawString(
Minecraft.getInstance().font, Minecraft.getInstance().font,
getGunAmmoCount(player) + "", getGunAmmoCount(player) + "",
w / 1.5f - 64 / 1.5f + 1, w / 1.5f - 64 / 1.5f,
h / 1.5f - 32, h / 1.5f - 48 / 1.5f,
0xFFFFFF, 0xFFFFFF,
true true
); );
@ -119,14 +119,14 @@ public class AmmoBarOverlay {
); );
poseStack.pushPose(); poseStack.pushPose();
poseStack.scale(0.9f, 1f, 1f); poseStack.scale(0.9f, 0.9f, 1f);
// 渲染物品名称 // 渲染物品名称
event.getGuiGraphics().drawString( event.getGuiGraphics().drawString(
Minecraft.getInstance().font, Minecraft.getInstance().font,
centerString(gunItem.getGunDisplayName(), 20), centerString(gunItem.getGunDisplayName(), 20),
w / 0.9f - 144 / 0.9f, w / 0.9f - 144 / 0.9f,
h - 60, h / 0.9f - 60 / 0.9f,
0xFFFFFF, 0xFFFFFF,
true true
); );
@ -136,7 +136,7 @@ public class AmmoBarOverlay {
Minecraft.getInstance().font, Minecraft.getInstance().font,
centerString(getGunAmmoType(stack), 20), centerString(getGunAmmoType(stack), 20),
w / 0.9f - 144 / 0.9f, w / 0.9f - 144 / 0.9f,
h - 51, h / 0.9f - 51 / 0.9f,
0xC8A679, 0xC8A679,
true true
); );