Post Event option for Overlays

Started by chocolate_box43 on

Topic category: Feature requests and ideas for MCreator

Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Post Event option for Overlays

An option that would make overlays a lot more useful would be, to add an option to switch to Post-rendering, instead of Pre-rendering. I personally use this for custom boss bars by changing a few characters in the code, and it would be very convenient to just have an option in the element customization window, so that I don't have to re-edit the code if I need to unlock it for any reason.

public static void eventHandler(RenderGuiEvent.Pre event) ---> public static void eventHandler(RenderGuiEvent.Post event)

This seems relatively simple to add, and would be pretty nice to have for custom HUD elements and customization.

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Change the boss bar? It's…
Mon, 10/14/2024 - 06:44

Change the boss bar? It's useful for me! I have been trying to customize the boss health bar. Can you tell me how to operate it? If possible, it's best to attach the process or code. Thank you very much!

Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you open the code editor…
Thu, 10/17/2024 - 01:14

If you open the code editor on any overlay you should be able to find a line of code that says something like this:

public static void eventHandler(RenderGuiEvent.Pre event)

You just have to change the part that says "Pre event" to instead say "Post event" and you should be good.

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you for your guidance!…
Thu, 10/17/2024 - 16:23

Thank you for your guidance! But my current problem is how to locate the overlay to the boss's health bar position, which means I want to use the bar I drew myself to overlay the original boss bar. Is it possible to do this?

Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Getting it into the right…
Tue, 10/22/2024 - 00:24

Getting it into the right position mostly consists of trial and error. I would recommend doing things in this order:

  1. Make the element
  2. make sure your custom bar is using the "Top center" Anchor point
  3. Experiment with different positions for it until it matches up with the actual boss bar

    That should be all you need to do.

Joined Feb 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also you may need to edit…
Tue, 10/22/2024 - 00:25

Also you may need to edit your overlay texture to make sure it fits within the bounds of the screen.