Jump to content

[1.7.10/1.8] Drawing beneath the hotbar.


61352151511

Recommended Posts

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.

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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