Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 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/

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.