Skip to content

Commit

Permalink
fix custom overlay rendering issue
Browse files Browse the repository at this point in the history
  • Loading branch information
qouteall committed May 27, 2023
1 parent 7c6c3bb commit bd77800
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,17 @@ public static void render(PoseStack poseStack, float partialTick) {

poseStack.pushPose();

int screenWidth = minecraft.getWindow().getGuiScaledWidth();
int screenHeight = minecraft.getWindow().getGuiScaledHeight();

poseStack.translate(0, screenHeight * 0.3, 0);
int guiScaledWidth = minecraft.getWindow().getGuiScaledWidth();
int guiScaledHeight = minecraft.getWindow().getGuiScaledHeight();

Font font = minecraft.gui.getFont();

minecraft.getProfiler().push("imm_ptl_custom_overlay");
multiLineLabel.renderCentered(poseStack, screenWidth / 2, 90);
// Note: the parchment names are incorrect
multiLineLabel.renderCentered(
poseStack,
guiScaledWidth / 2, (int) (guiScaledHeight * 0.75)
);
poseStack.popPose();

minecraft.getProfiler().pop();
Expand Down

0 comments on commit bd77800

Please sign in to comment.