Posted February 14, 201510 yr 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] As well as if anyone knows how to get items to render like a glass bottle in hand like [spoiler=This] Instead of like [spoiler=This] 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.
February 14, 201510 yr 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
February 14, 201510 yr 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. The isFull3D thing fixed the other issue, thanks.
February 14, 201510 yr Hi Before rendering your red mask, try turn off drawing to the depth mask as well GL11.glDepthMask(false); -TGG
February 14, 201510 yr 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.
February 14, 201510 yr 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.
February 14, 201510 yr 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.
February 14, 201510 yr 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.