Posted May 18, 201411 yr I would like to know a way to use the RenderGameOverlayEvent to render something similar to what a pumpkin does (i.e. render's the pumpkin blur overlay on screen but BEHIND all the HUD things). I've tried .Post and .Pre for ElementType of HELMET, ALL and some of the hud stuff, such as EXPERIENCE. If I do .Pre, it renders correctly (my overlay), BUT all the HUD stuff disappears. If I do .Post, it renders correctly, but it renders ABOVE the HUD stuff (i.e. I have a semi-white texture and all the HUD stuff gains the effect of the texture). Does anyone know any way to achieve what I require? Thanks in advance.
May 18, 201411 yr Have you tried changing the zLevel at which you render? If your render code is affecting the vanilla rendering, you need to make sure that you disable/re-enable whatever settings you changed in openGL; for example, if you enable BLEND, be sure to disable it when you finish rendering. http://i.imgur.com/NdrFdld.png[/img]
May 18, 201411 yr Pumpkin dont render in game overlay...there is function for that in Item class , for rendering stuff if you armor is equiper on player. /** * Called when the client starts rendering the HUD, for whatever item the player currently has as a helmet. * This is where pumpkins would render there overlay. * * @param stack The ItemStack that is equipped * @param player Reference to the current client entity * @param resolution Resolution information about the current viewport and configured GUI Scale * @param partialTicks Partial ticks for the renderer, useful for interpolation * @param hasScreen If the player has a screen up, which will be rendered after this. * @param mouseX Mouse's X position on screen * @param mouseY Mouse's Y position on screen */ @SideOnly(Side.CLIENT) public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY){}
May 18, 201411 yr Author Have you tried changing the zLevel at which you render? If your render code is affecting the vanilla rendering, you need to make sure that you disable/re-enable whatever settings you changed in openGL; for example, if you enable BLEND, be sure to disable it when you finish rendering. I'll try that Alias, thank you. I'll play around with it abit first and then report back as to if it worked, in case you want to use it yourself.
May 18, 201411 yr Author Have you tried changing the zLevel at which you render? If your render code is affecting the vanilla rendering, you need to make sure that you disable/re-enable whatever settings you changed in openGL; for example, if you enable BLEND, be sure to disable it when you finish rendering. Pumpkin dont render in game overlay...there is function for that in Item class , for rendering stuff if you armor is equiper on player. /** * Called when the client starts rendering the HUD, for whatever item the player currently has as a helmet. * This is where pumpkins would render there overlay. * * @param stack The ItemStack that is equipped * @param player Reference to the current client entity * @param resolution Resolution information about the current viewport and configured GUI Scale * @param partialTicks Partial ticks for the renderer, useful for interpolation * @param hasScreen If the player has a screen up, which will be rendered after this. * @param mouseX Mouse's X position on screen * @param mouseY Mouse's Y position on screen */ @SideOnly(Side.CLIENT) public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY){} Thank you to both of you for your help. It now works. I took coolAlias's advice on re-verting everything I changed in GL11, and I used the reference to the pumpkin overlay from TechoMan to help me reproduce the overlay code. All I did was take the code from the pumpkin overlay and stick it in the RenderGameOverlayEvent.Post, with the ElemenType checked for as HELMET.
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.