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.

[1.8] [Solved] Gui not being rendered properly (texture.png > 256x256)

Featured Replies

Posted

So I'm creating a new book GUI that is basically a tutorial book like those seen in Thaumcraft/Botania/TConstruct/etc. However when I added buttons and a few GUI elements to my image it seems to just bug out and place the textures in weird positions / not even show them.

 

-snip-

 

The first set of coordinates is the location of the top left corner of my book texture in minecraft's window.

The next 3 sets of coordinates are for each of the nextpage/prevpage/etc buttons being drawn (not the chapterButtons).

The pairs of coordinates mean, respectively, the top left corner of the buttons texture, the bottom right corner of the buttons texture (both of these are in respect to the texture.png file. They make a box that contains the texture of the button), and the third pair of coordinates refers to the location of the button within minecraft's window.

 

Now I'm pretty certain that, by default minecraft's window's size is 640x480 so surely all these buttons should be properly rendered within the window.

 

I know this is probably a bit messy and hard to read, but can anyone check if my math is off or if I am just doing some stuff completely wrong that would be great, as I've been at this for the last couple hours and can't seem to fix it...

 

(Also, as a side note, whenever I click a button it makes the sound numerous times... which I'm going to put down to not doing something right with buttonList. And finally, there are a few things here that are empty or incomplete, such as renderScreen(), that's just because I haven't gotten around to finishing it because of this stupid problem.

No signature for you!

  • Author

So after a bit of tinkering I found out my problem and just want to share with you if anyone has a similar problem.

 

The issue I was having is that my texture image was >256x256 in size (even though it was still square). Therefore I had to use the method drawModalRectWithCustomSizedTexture() rather than drawTexturedModalRect().

No signature for you!

So after a bit of tinkering I found out my problem and just want to share with you if anyone has a similar problem.

 

The issue I was having is that my texture image was >256x256 in size (even though it was still square). Therefore I had to use the method drawModalRectWithCustomSizedTexture() rather than drawTexturedModalRect().

 

you can have it any multiple of 256, I honestly usually start with a canvas of 1024 and create the picture in a 256 x 256 square in the top left corner

You can't have a bigger texture than 256 if you are using the

drawTexturedModelRect()

method. Bigger images just get cropped in the GUI and looks awful if you have some detail in the GUI texture.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

You can't have a bigger texture than 256 if you are using the

drawTexturedModelRect()

method. Bigger images just get cropped in the GUI and looks awful if you have some detail in the GUI texture.

 

Worked perfectly for me, I need to check it with greater details then.

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.