Jump to content

Custom Screen Overlay 1.16.5


Faro

Recommended Posts

I want to make a custom screen overlay. So when a boolean is true, I want that the screen to have a red overlay. I looked up in the IngameGui class and the renderPortalOverlay method but I don t know how to make a custom GUI

Edited by Faro
Link to comment
Share on other sites

that helped i found the code. its in a file called GuiIngame.java. i dont know the file path for it but it contains a bunch of code for overlay gui effects and stuff so it should help a lot.

steps to find it in intellij are right click on a folder in the project, click 'find in files' button, search for "pumpkinblur.png" and click the scope button.

Link to comment
Share on other sites

Ok thank you I made it like this and it works.

 @SubscribeEvent
  @OnlyIn(Dist.CLIENT)
  public static void RenderHUD(final RenderGameOverlayEvent event){
        if (isRampage){
           int  screenColor = 0xfff00000;
           Minecraft mc = Minecraft.getInstance();

           
            MatrixStack stack = event.getMatrixStack();
            stack.pushPose();
            int w = (mc.getWindow().getGuiScaledWidth());
            int h = (mc.getWindow().getGuiScaledHeight());

              
                float r = (float) (screenColor >> 16 & 255) / 255.0F;
                float g = (float) (screenColor >> 8 & 255) / 255.0F;
                float b = (float) (screenColor & 255) / 255.0F;
                float a = (1/ 100f) * (screenColor >> 24 & 255) / 255F;

                   RenderSystem.disableTexture();
                   RenderSystem.enableBlend();
                   RenderSystem.disableAlphaTest();
                   RenderSystem.blendFuncSeparate(770, 771, 1, 0);
                   RenderSystem.shadeModel(7425);
                   Tessellator tessellator = Tessellator.getInstance();
                   Matrix4f matrix = stack.last().pose();
                   BufferBuilder worldrenderer = tessellator.getBuilder();
                   worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
                   worldrenderer.vertex(matrix, 0, h, mc.gui.getBlitOffset()).color(r, g, b, a).endVertex();


                   worldrenderer.vertex(matrix, w, h, mc.gui.getBlitOffset()).color(r, g, b, a).endVertex();
                   worldrenderer.vertex(matrix, w, 0, mc.gui.getBlitOffset()).color(r, g, b, a).endVertex();
                   worldrenderer.vertex(matrix, 0, 0, mc.gui.getBlitOffset()).color(r, g, b, a).endVertex();

                   tessellator.end();
                   RenderSystem.shadeModel(7424);
                   RenderSystem.disableBlend();
                   RenderSystem.enableAlphaTest();
                   RenderSystem.enableTexture();
                   


        }
  }

 

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • So, I started a Forge server which is hosted by cloudnord (don't know it this information is necessary or not). Everything's working fine, the mods are getting loaded, I can join and play on it. Then I wanted to give myself OP. That's where the problems began. I typed "op mc_nicky_com" in the console and just saw, that I automatically disconnected... Weird, I thought and promptly updated the forge version to the client sided version, 47.2.17. Nothing resolved. Thought of downgrading the server to 47.2.0 but still didn't work. Now the server is on 47.2.0 and I can play without OP, which is totally fine but if I want to do something only OPs can do, I have to put it into the console, where I don't have auto-completion. The error it is throwing is the following: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(31613) + length(1) exceeds writerIndex(31613): UnpooledHeapByteBuf(ridx: 31613, widx: 31613, cap: 31613/31613) I don't know how to fix this and I am thankful for every help attempt that comes here.  With best regards nicky.gg
    • Official Website Link ➲➲➲  https://groups.google.com/a/chromium.org/g/chromium-reviews/c/Zyy6WGX5-gA   Product Name ➲➲➲ Keto Candies ACV Gummies It assists with smothering undesirable food desires and close to home dietary patterns.   Official facebook Link ➲➲➲  https://www.facebook.com/KetoCandiesACVGummiesUS/   Official Blogs ➲➲➲ https://groups.google.com/a/chromium.org/g/chromium-reviews/c/4LZAdq7rQSg https://groups.google.com/g/mozilla.dev.platform/c/Uy2KvvUkCbA https://groups.google.com/g/mozilla.dev.platform/c/L-RBHHTlJm0 https://groups.google.com/g/comp.protocols.time.ntp/c/aqbT3woiM9w https://groups.google.com/g/comp.protocols.time.ntp/c/L3J_LIFnET0 https://groups.google.com/a/chromium.org/g/chromium-reviews/c/Zyy6WGX5-gA https://groups.google.com/a/chromium.org/g/chromium-reviews/c/4LZAdq7rQSg https://keto-candies-acv-gummies-2b37b5.webflow.io/ https://keto-candies-acv-gummies-1.jimdosite.com/ https://groups.google.com/g/getketocandiesacvgummies/c/PaSsvPpQsYw https://groups.google.com/g/getketocandiesacvgummies/c/YLKzSrTdeRI   Blue Vibe CBD Gummies Official Links ➲➲➲  https://www.deccanherald.com/brandspot/sponsored-health/blue-vibe-cbd-gummies-reviews-moneyworth-product-or-not-blue-vibe-cbd-gummies-for-sale-consumer-reports-mega-sale-2673730 https://www.facebook.com/GetBlueVibeCBDGummiesUS/ https://www.facebook.com/BlueVibeCBDGummiesUS/ https://www.facebook.com/BlueVibeCBDGummiesInUS/ https://www.facebook.com/events/334310428943928 https://groups.google.com/a/chromium.org/g/chromium-reviews/c/eq2xmAl5Mm4 https://groups.google.com/a/chromium.org/g/chromium-reviews/c/yb2GhvIIBvI Group Google ➲➲  https://groups.google.com/a/chromium.org/g/chromium-reviews/c/LEwhDmgZLHs Group Google ➲➲  https://groups.google.com/a/chromium.org/g/chromium-reviews/c/gREHzPUfMsw Group Google ➲➲  https://groups.google.com/a/chromium.org/g/chromium-reviews/c/FNtpXHp_r7c Group Google ➲➲  https://groups.google.com/a/chromium.org/g/chromium-reviews/c/KqdhsIEuP8k Group Google ➲➲  https://groups.google.com/a/chromium.org/g/chromium-reviews/c/XfZtZqnG-rM Group Google ➲➲ https://groups.google.com/g/comp.os.vms/c/DGXPLV27qCU Group Google ➲➲ https://groups.google.com/g/comp.os.vms/c/t-W4cjZOFSs Group Google ➲➲ https://groups.google.com/g/comp.os.vms/c/i0Ta7Qy4izw
    • Make a test without practical_plushies_mobs, practical_plushies_animals and dark-waters - looks like it is not working with sinytra connector
    • VIP Call Girlfriend in Abu Dhabi ☮➡+971557861567(㎓) Escorts In Abu Dhabi   VIP Call Girlfriend in Abu Dhabi ☮➡+971557861567(㎓) Escorts In Abu Dhabi   VIP Call Girlfriend in Abu Dhabi ☮➡+971557861567(㎓) Escorts In Abu Dhabi
    • Maybe your file codes are missing. Therefore it is crashing.
  • Topics

×
×
  • Create New...

Important Information

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