Jump to content

[1.14.4] GUI is tiled


Cerandior

Recommended Posts

My gui is a little big to fit in the standard 256x256 size, so I made a 512x512 texture for it. However now the gui is scaled down by minecraft and it's being tiled.

See here: https://prnt.sc/r2f61q

The xSize and ySize are set correctly. Does this have to do with the way drawGuiContainerBackgroundLayer scales the gui depending on the window size?

 

Container: https://github.com/arjolpanci/VanillaExtended/blob/master/src/main/java/teabx/vanillaextended/container/CollectiveStorageContainer.java
Screen: https://github.com/arjolpanci/VanillaExtended/blob/master/src/main/java/teabx/vanillaextended/client/gui/CollectiveStorageScreen.java

Edited by Cerandior
Link to comment
Share on other sites

You didn't tell the parent class what your gui width and height are, so it assumes the default values, which are out of an assumed total of 256 when calculating UVs (which are what's actually used when drawing the gui).

  • Thanks 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

23 minutes ago, Draco18s said:

You didn't tell the parent class what your gui width and height are, so it assumes the default values, which are out of an assumed total of 256 when calculating UVs (which are what's actually used when drawing the gui).

I called setSize in the constructor and gave it 512 for both width and height but nothing changed. Also I remember that a couple of years ago you couldn't have large GUI's because they were hard-coded to only accept 256x256 images. You had to use a tessellator and draw it yourself. Does that limitation still exist nowadays?

Link to comment
Share on other sites

54 minutes ago, A-Game said:

For the Screen, have you tried to put in your constructor "this.width = super.width * 2" & "this.height = super.height * 2" to double the size instead of setSize method?

I don't really think that is any different from the setSize.

 

48 minutes ago, diesieben07 said:

Depends on how you draw your background texture.

If you just copied the vanilla code (using the blit method) then yes, that method by default assumes 256x256 textures. Look at it's code, it is pretty obvious how to change that.

Thank you, It's fixed now. 

Next time I'll look more carefully before asking for something here. I did open up the AbstractGui class to look into the blit method, but when I saw a bunch of meaningless variable names I stopped looking. 

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.