Jump to content

Issue with rendering a GuiGraphics rectangle on top of every other gui element.


spin

Recommended Posts

Hello forum members!

I am relatively new to Forge and I'm having issues with implementing my custom gui elements.

Essentially what I'm trying to do is to add a singular rectangle shape which sits on top of every other gui element that's rendered to the player's screen in the Screen object (i.e. when the player is in their inventory or accessing some other inventory like a tile entity and so on...), so essentially i need this rectangles z-index to be the highest out of every other gui element. Later on I plan on adding functionality to this rectangle; the rectangle will serve as the background element.

 

The way I undertand how the GuiGraphics class works is that when you have a SubscribeEvent method which handles rendering of the gui it gets the GuiGraphics object from the event that gets created when the method triggers and then modifys that gui elements of that event. But the issue then is that if I'm targeting the RenderGuiOverlayEvent.Post event and try to add the rectangle with the fill method what ends up happening is that the rectangle gets rendered behind the Screen object.

 

Essentially my question is:
Is there an event that gets fired when the absolute last gui element gets rendered and if not is there a WorldLastEvent in terms of gui that gets fired

and how does the gui rendering pipeline work in minecraft 1.20, what is the order in which different gui elements get fired?

 

Any help or feedback would be grately appreciated!

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.



×
×
  • Create New...

Important Information

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