Jump to content

Recommended Posts

Posted

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
}

 

LH7iJWb.png

Posted

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)

Posted

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) :D

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.

Posted

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.

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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