Posted February 23, 201312 yr After adjusting the xSize and ySize of my GUI and loading a new image, I randomly got a stretched look on it. Changing the GUI image back to the previous image and sizes still didn't help the problem, and it now seems to be stuck stretched. My GUI code: package ccreations; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Container; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; public class GuiPrepTable extends GuiContainer { private TileEntityPrepTable table; public GuiPrepTable(InventoryPlayer inventoryPlayer, TileEntityPrepTable tileEntity) { super(new ContainerPrepTable(inventoryPlayer, tileEntity)); this.xSize = 230; this.ySize = 219; //This is the same size as a beacon's GUI this.table = tileEntity; } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { String herp = Integer.toString((this.width-xSize)) + "/" + Integer.toString(this.height-ySize); fontRenderer.drawString(herp, 8, 6, 4210752); } @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { int var4 = this.mc.renderEngine.getTexture("/ccreations/ccgui/preparation_old.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(var4); int var5 = (this.width - this.xSize) / 2; int var6 = (this.height - this.ySize) / 2; this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize); } } What the GUI looks like:
February 23, 201312 yr maybe check the dimensions of the image? that has gotten me more than enough times Also, I should have you know that you are reading my signature.
February 23, 201312 yr Author I do think that is the problem. I noticed how every single GUI used by vanilla Minecraft is 256*256, so whatever is rendering the images probably just goes like NOAP SQUISH IT IT'S EVIL whenever it sees an image with dimensions other than 256*256. Thanks anyways for helping.
February 23, 201312 yr actually the variables xSize and ySize need to be the size of the part of the image that ISN'T blank
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.