Jump to content

[1.16.4] Costum screen doesn't display background image


Tavi007

Recommended Posts

Hello!

I tried to implement my first GUI, which functionality is similar to the vanilla crafting table. I got almost everything working: I got a block, a container and a screen all registered and the container also opens, when i right-click on my new block. However the screen is missing the background image and has a wrong title/name at the top. This lets me believe, that my error lies within the resource location or my assets, but I'm sure I named everything correctly. So please take a look and help me out.

Thank you in advance :)

 

Here is my github:

https://github.com/Tavi007/Materia

(you can find the screen registration in the client.init package)

Edited by Tavi007
Link to comment
Share on other sites

 

4 hours ago, Tavi007 said:

 However the screen is missing the background image

in the drawGuiContainerBackgroundLayer method you need to call blit() after binding the texture to actually draw it to the screen. Binding the texture simply sends the image to the gpu, but doesn't draw it.

 

4 hours ago, Tavi007 said:

and has a wrong title/name at the top.

in the drawGuiContainerForegroundLayer you don't need to draw the title, calling the method on super already does that. super.drawGuiContainerForegroundLayer draws both the inventory title and the player inventory title

Edited by kiou.23
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.

Announcements



×
×
  • Create New...

Important Information

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