Jump to content

[1.8.8] Gui Texture drawn wrong


61352151511

Recommended Posts

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.