Posted September 6, 20178 yr I am working on a mod that adds some overlays to the game, and for one of them I wanted to render an entity on the hud, but I'm having some problems positioning it where I want it. I am using the RenderGameOverlayEvent.Post event to render it to the hud. When I don't apply any translations it appears in the top left of the screen, which makes sense. Since I want it to show up in the bottom left, I would assume I have to translate it by the height of the screen (I assumed was Minecraft.getMinecraft().displayHeight). However this doesn't work, I have to divide it by 2 to get it to show up at the bottom. I am very confused by this behavior. Then if I make the game fullscreen, the model disappears. I assume there is some kind of scaling going on here, but I have no idea how to reliably calculate the amount I want to translate the model down by. The translation I am currently using is: GlStateManager.translate(25F, mc.displayHeight / 2F - 10, 50F); which somehow works on the default window size. The entire class can be found here: https://github.com/wesserboy/Overlays-MC-/blob/master/src/main/java/com/wesserboy/overlays/renderers/BowAimHelp.java Anyone know how I can render the model in the bottom left of the hud, independent of the window size? Edited September 6, 20178 yr by wesserboy Adding a [Solved] tag to the title I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/
September 6, 20178 yr Author I have figured it out, it was indeed a scaling issue. After looking at the event class I noticed it supplies you with a resolution. I solved it by getting the scaled height form the event: event.getResolution().getScaledHeight_double() I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/
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.