Jump to content

GUI being stretched in a weird way


Rockdude101

Recommended Posts

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:

 

A2fhxkY.png

 

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.