Posted December 4, 201410 yr I made a block that has it's own gui, when I rightClick it however, it does something really wierd. Here is a sceenshot: Here is my code: The gui: public class ArcaneHarnesserGui extends GuiScreen{ public static final int GUI_ID = 20; private static final ResourceLocation guiTexture = new ResourceLocation("wizardry", "/textures/gui/arcaneHarnesserGui.png"); private int ImageWidth = 176; private int ImageHeight = 166; @Override public void drawScreen(int x, int y, float par3){ int k = (this.width - this.ImageWidth) / 2; byte b0 = 2; this.drawTexturedModalRect(k, b0, 0, 0, this.ImageWidth, this.ImageHeight); this.mc.getTextureManager().bindTexture(guiTexture); } } The code in my block that opens the gui: @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_){ player.openGui(Wizardry.instance, ArcaneHarnesserGui.GUI_ID, world, x, y, z); return true; } My guiHandler: public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement ( int ID, EntityPlayer player, World world, int x, int y, int z ) { return null; } @Override public Object getClientGuiElement ( int ID, EntityPlayer player, World world, int x, int y, int z ) { Object result = null; if (ID == ArcaneHarnesserGui.GUI_ID){ result = new ArcaneHarnesserGui(); } return result; } } Edit: Here is what it should look like:
December 4, 201410 yr You bind the texture after you draw. That's not right. Thanks that worked, but what would cause it to make letters like that when I bind it after?
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.