Posted December 18, 20159 yr It appears more than once, this is with the texture size being 512x512 (Same thing occurs when cropped to the proper size of 372x166). Anyone that can help? @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1, 1, 1, 1); this.mc.getTextureManager().bindTexture(backgroundTexture); drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize); //xSize being 372, ySize being 166 }
December 18, 20159 yr drawTexturedModalRect uses a 256 x 256 texture. If you want to load a different size you'll need to make your own draw function. scratch that. 0.00390625F is 1 / 256 Edit: Ernio is correct, drawModalRectWithCustomSizedTexture is what you want. For my mods in-game wiki I needed scaling, flipping, and custom sizes; so I coded a function that did everything and completely forgot Minecraft had more then drawTexturedModalRect (not sure when drawScaledCustomSizeModalRect appeared but I'm sure it wasn't there before, I could have used it for about 2/3rds of my images)
December 18, 20159 yr If you want to load a different size you'll need to make your own draw function. 0.00390625F is 1 / 256 I'd like to note that there is alredy method that has size args (...withCustomSize() or something). Since you are drawing container, I'd also like to note: (might come in handy) http://www.minecraftforge.net/forum/index.php/topic,31297.msg165510.html#msg165510 1.7.10 is no longer supported by forge, you are on your own.
December 18, 20159 yr Author I was about to post about how it still doesn't worked and then realised you put lots of emphasis on the fact xSize and ySize has to be in the constructor. I noticed that mine were just declared outside of it, changed it, and it worked. Thank you guys so much for helping to fix this.
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.