Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

 

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.

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

 

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.