Posted June 29, 20205 yr Howdy y'all, I'm trying to use GL scaling to render small versions of text on a custom-rendered ItemStack, however, this is not working nearly how I want it to. It's very close, however, the text is appearing behind the stack. Any idea why? @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { super.drawGuiContainerForegroundLayer(mouseX, mouseY); if(tsfm.storedItem == null) { this.font.drawString("Empty", 52, 13, 0xffffff); }else { this.font.drawString(tsfm.storedItem.getName().getFormattedText(), 52, 13, 0xffffff); if(tsfm.internalStored < 10_000_000) { this.font.drawString("Stored: " + Formatting.GENERAL_FORMAT.format(tsfm.internalStored), 52, 25, 0xd4d4d4); }else { this.font.drawString("Stored: " + SCINOT.format(tsfm.internalStored), 52, 25, 0xd4d4d4); } RenderSystem.pushMatrix(); RenderSystem.scalef(0.5f, 0.5f, 0.5f); this.itemRenderer.renderItemOverlayIntoGUI(this.font, tsfm.storedItem.getDefaultInstance(), (25)*2, (68)*2, "Hello!"); RenderSystem.popMatrix(); } } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY); int x = (this.width - this.xSize) / 2; int y = (this.height - this.ySize) / 2; if(tsfm.storedItem != null) { this.itemRenderer.renderItemIntoGUI(tsfm.storedItem.getDefaultInstance(), (x+17), (y+60)); } } I have tested it, and rendering ItemOverlayIntoGUI works correctly and places on top of the item as proper when scaling is not involved. EDIT: I actually got it all worked out. Thank you. Edited June 29, 20205 yr by Haydenman2 ...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.