Posted September 27, 20159 yr 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!
September 28, 20159 yr 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!
September 30, 20159 yr 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
September 30, 20159 yr 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/
September 30, 20159 yr 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.