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

Simply put, I would like to know how to draw the image before/underneath the hotbar. As you can see in the image below the image is drawn after the hotbar. Items are drawn after the image but not shown in the picture. Normally whenever I do stuff with GUI I render it alongside the experience and in the post event. I tried changing to the pre event and the entire blank area of the circle was white and the rest pure red (No opacity at all) I tried keeping it on the post event but changing to ElementType.HOTBAR and got the same result. Any tips would really help.

 

Edit: As well as in 1.7.10 ( Not sure if it happens in 1.8 ) If the last item in the hotbar to be rendered hasEffect() == true, the white appears in the middle again however it does have opacity.

 

@SubscribeEvent(priority = EventPriority.NORMAL) public void onRender(RenderGameOverlayEvent.Post event) {
if (event.isCanceled() || event.type != ElementType.EXPERIENCE || TimeInfectedTrackingClient.getSecondsInfected() < 60) return;
ScaledResolution sr = new ScaledResolution(minecraftInstance, minecraftInstance.displayWidth, minecraftInstance.displayHeight);

minecraftInstance.renderEngine.bindTexture(new ResourceLocation(Reference.MOD_ID.toLowerCase(), "textures/gui/eyeinfection.png"));
drawModalRectWithCustomSizedTexture(0, 0, 0, 0, sr.getScaledWidth(), sr.getScaledHeight(), sr.getScaledWidth(), sr.getScaledHeight());
}

 

[spoiler=Rendering]

nseTo1s.png

 

 

 

As well as if anyone knows how to get items to render like a glass bottle in hand like

[spoiler=This]

QREGh7W.png

 

 

Instead of like

[spoiler=This]

BKUw4Nc.png

 

 

In 1.7.10 that would be apprecated. 1.8 works fine because of the models and being able to change the rotation, size, etc. Within the json file.

Hi

 

Did you try rendering in pre and turning blending on using OpenGL?

 

 

Item.isFull3D() is what you need to change for the bottle in 1.7.10.

 

-TGG

  • Author

@SubscribeEvent(priority = EventPriority.NORMAL) public void onRender(RenderGameOverlayEvent.Pre event) {
if (event.isCanceled() || event.type != ElementType.HOTBAR || TimeInfectedTrackingClient.getSecondsInfected() < 60) return;
ScaledResolution sr = new ScaledResolution(minecraftInstance, minecraftInstance.displayWidth, minecraftInstance.displayHeight);

GL11.glEnable(GL11.GL_BLEND);
minecraftInstance.renderEngine.bindTexture(new ResourceLocation(Reference.MOD_ID.toLowerCase(), "textures/gui/eyeinfection.png"));
drawModalRectWithCustomSizedTexture(0, 0, 0, 0, sr.getScaledWidth(), sr.getScaledHeight(), sr.getScaledWidth(), sr.getScaledHeight());
GL11.glDisable(GL11.GL_BLEND);
}

 

The game now looks like this.

 

NWTP3ve.png

 

The isFull3D thing fixed the other issue, thanks.

  • Author

Thanks, it goes behind the hotbar now with this.

 

@SubscribeEvent(priority = EventPriority.NORMAL) public void onRender(RenderGameOverlayEvent.Pre event) {
if (event.isCanceled() || event.type != ElementType.HOTBAR || TimeInfectedTrackingClient.getSecondsInfected() < 1) return;
ScaledResolution sr = new ScaledResolution(minecraftInstance, minecraftInstance.displayWidth, minecraftInstance.displayHeight);

GL11.glEnable(GL11.GL_BLEND);
GL11.glDepthMask(false);
minecraftInstance.renderEngine.bindTexture(new ResourceLocation(Reference.MOD_ID.toLowerCase(), "textures/gui/eyeinfection.png"));
drawModalRectWithCustomSizedTexture(0, 0, 0, 0, sr.getScaledWidth(), sr.getScaledHeight(), sr.getScaledWidth(), sr.getScaledHeight());
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
}

 

However any hasEffect item renders weirdly.

 

MjisJvC.png

I'd just like to add - at 30 000 000 coords there is a world-border that makes player have reddish something (by something I mean I don't know the word and mean exact same thing you want to do - I mean this red outline).

 

You might wanna check it, maybe even use it.

 

Also: http://minecraft.gamepedia.com/Block_models

"display": {
        "thirdperson": {
            "rotation": [ -90, 0, 0 ],
            "translation": [ 0, 1, -3 ],
            "scale": [ 0.55, 0.55, 0.55 ]
        },
        "firstperson": {
            "rotation": [ 0, -135, 25 ],
            "translation": [ 0, 4, 2 ],
            "scale": [ 1.7, 1.7, 1.7 ]
        }
    }

Have a look at it regarding your bottle.

Edit: Ah sorry, you wanted 1.7.10 rotation? You could make renderFull3D false (i think).

1.7.10 is no longer supported by forge, you are on your own.

  • Author

The bottle issue was fixed. It was 1.7.10 only which didn't have block models. I specifically said in the post "It's fine on 1.8 because of models"

 

The border doesn't help me because I need it on 1.7.10 as well.

Try saving and restoring the settings instead of just setting them to off after your render.

 

GL11.glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_ENABLE_BIT);

//.. render here

GL11.glPopAttrib();

 

-TGG

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.