Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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).

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.

  • Author
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?

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?

  • Author
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. 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.