Jump to content

[1.19.3] GUI registration?


chxr

Recommended Posts

Okay so since my other post I've seen some other posts and videos.

My custom GUI now extends Screen, so I have a couple of questions I'm not quite getting:
 

1) Does the code that renders image, text and other elements be on a render() mehtod? on an init() method?

2) How do I register the GUI? Some other answers I've seen are for GUIS inside buttons, or items, but mine needs to be visible while the player moves (like the hotbar, for example) and I haven't found any good examples. Where in the vanilla code can I see where the vanilla GUIs are registred?

Link to comment
Share on other sites

You can look at the hotbar classes to see how to render a hud element. However, you should not use vanilla methods for registering things. Those are exclusive to vanilla. You can find a better example here, however.

  • Like 1

I'm not good at modding, but at least I can read a crash report (well enough). That's something, right?

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.