Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.19] Creating new overlay gui


Zanckor
 Share

Recommended Posts

Eya!

I'm trying to do a overlay gui with images (only images, no strings), to do a health bar, like a typical MMORPG overlay gui, but I'm not finding any references on vanilla to do it, so, i would like to know what class to extend, or any vanilla code to check

Link to comment
Share on other sites

Mhh, I don't know how it really works, i'm trying with OverlayRegistry, ForgeIngameGui and Gui, but don't get it.

 

All I have is that:

https://ibb.co/VxhzPwy to create my overlay

https://ibb.co/P1FMVf9 and that's my GUI class with my gui delimited

 

I've tried to do something like this like ForgeIngameGui: https://ibb.co/HrpCWt8 but I can't create a new protected void render

Link to comment
Share on other sites

17 minutes ago, diesieben07 said:
  • Do not store the Minecraft instance in a field. Minecraft is already a singleton.

Done, tnxs

 

17 minutes ago, diesieben07 said:
  • You need to learn the basics of Java, specifically the difference between static and non-static members.

Ya, i know that it needs to be static, but i cant call "blit" method if it's static 

Link to comment
Share on other sites

If it helps, I did something similar recently.

This is the overlay class, implementing IIngameOverlay:

https://github.com/Syrikal/alchemine/blob/main/src/main/java/syric/alchemine/client/VitaSlimeOverlay.java

Here's my overlay registry class, which triggers at the same time I register blocks and items and whatnot:

https://github.com/Syrikal/alchemine/blob/aae585ab7d23fd4be688a60642f200ab09a4fe38/src/main/java/syric/alchemine/setup/AlchemineOverlays.java

And here's where I turn the overlays on and off (it's triggered by RenderFogEvent because it happens concurrently with some fog stuff, but this is a little hacky.)

https://github.com/Syrikal/alchemine/blob/47d9d08a092d3e26441bace8fb5014db0c78c332/src/main/java/syric/alchemine/client/FogEffects.java

  • Thanks 1
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
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.

 Share



×
×
  • Create New...

Important Information

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