Posted July 14, 201411 yr Does a GUI texture, always have to be 256x256? I tried using one that was 176x176 but the image displayed like it was magnified. I am just curious to know.
July 14, 201411 yr Author I thought so, if you had a large GUI that wouldn't fit onto a 256x256 image, would there be a way around that or would you have to just change it to fit?
July 14, 201411 yr Yes. In the drawTexturedModalRect method is are two values: f and f1. Those floats represent the image width and height. To get these values you devide 1 by 256, the image size. So to make a larger image possible, copy that method, and change f and f1 to be 1/imageWidth and 1/imageHeight. 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/
July 14, 201411 yr You can use this custom method that does not need a 256x Texture public static void drawTexturedQuadFit(double x, double y, double width, double height, double zLevel) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(x + 0, y + height, zLevel, 0,1); tessellator.addVertexWithUV(x + width, y + height, zLevel, 1, 1); tessellator.addVertexWithUV(x + width, y + 0, zLevel, 1,0); tessellator.addVertexWithUV(x + 0, y + 0, zLevel, 0, 0); tessellator.draw(); }
July 14, 201411 yr Author Great, thank you. I am trying to learn about GUIs so this i very useful to know.
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.