Jump to content

Recommended Posts

Posted

My gui appears fine. However, only the top-left part of my Gui is drawn. In the code, I specify the correct width and height of the image, so I'm at a loss as to what is doing it. Here is the code:

 

package com.artman41.pockets.gui;

import org.lwjgl.opengl.GL11;

import com.artman41.pockets.misc.Reference;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;

public class Pocket1 extends GuiScreen{

ResourceLocation texture = new ResourceLocation(Reference.modID.toLowerCase(), "textures/gui/background.png");

public final int xSizeofTexture = 105, ySizeofTexture = 107;

public Pocket1(EntityPlayer player){

}

@Override
public void drawScreen(int x, int y, float f){
	drawDefaultBackground();

	GL11.glColor4f(1f, 1f, 1f, 1f);

	Minecraft.getMinecraft().getTextureManager().bindTexture(texture);

	int posX = (this.width - xSizeofTexture) / 2;
	int posY = (this.height - ySizeofTexture) / 2;

	drawTexturedModalRect(posX, posY, 0, 0, xSizeofTexture, ySizeofTexture);

	super.drawScreen(x, y, f);
}

@Override
public boolean doesGuiPauseGame(){
	return false;
}
}

 

And here is the image: m8843kv.png

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.