Posted April 29, 20187 yr I made a tileEntity, a container, a guiHandler, everything needed but the Gui just glitches. I can't see the text box when my mouse is over the items, and there's no darker background when opened. Can somebody tell me, what's the problem? Here's my code: package net.gml.mod.block.specific_blocks.assembler; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.util.ResourceLocation; import net.gml.mod.gmlMod; import net.gml.mod.block.ModBlocks; public class GuiAssembler extends GuiContainer { private static final ResourceLocation BG_TEXTURE = new ResourceLocation(gmlMod.modId, "textures/gui/assembler.png"); private InventoryPlayer playerInv; public GuiAssembler(Container container, InventoryPlayer playerInv) { super(container); this.playerInv = playerInv; } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1, 1, 1, 1); mc.getTextureManager().bindTexture(BG_TEXTURE); int x = (width - xSize) / 2; int y = (height - ySize) / 2; drawTexturedModalRect(x, y, 0, 0, xSize, ySize); } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { String name = I18n.format(ModBlocks.assembler.getUnlocalizedName() + ".name"); fontRenderer.drawString(name, xSize / 2 - fontRenderer.getStringWidth(name) / 2, 6, 0x404040); fontRenderer.drawString(playerInv.getDisplayName().getUnformattedText(), 8, ySize - 94, 0x404040); } } procedure WakeMeUp(Integer plusTime); var I: Integer; begin for I := 0 to plusTime do begin println('One more minute!'); Sleep(1000); end; println('Okay, nothing to worry, I''m alive!'); println('So... somebody can give me a coffee?'); println('I know it''s Pascal, and not Java, but I love it :D.'); end;
April 30, 20187 yr Author Bump. Please? procedure WakeMeUp(Integer plusTime); var I: Integer; begin for I := 0 to plusTime do begin println('One more minute!'); Sleep(1000); end; println('Okay, nothing to worry, I''m alive!'); println('So... somebody can give me a coffee?'); println('I know it''s Pascal, and not Java, but I love it :D.'); end;
April 30, 20187 yr If you want to have the tinted background and the tooltips display override the drawScreen method: @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); //Add this super.drawScreen(mouseX, mouseY, partialTicks); this.renderHoveredToolTip(mouseX, mouseY); //Add this }
April 30, 20187 yr Author Thanks! procedure WakeMeUp(Integer plusTime); var I: Integer; begin for I := 0 to plusTime do begin println('One more minute!'); Sleep(1000); end; println('Okay, nothing to worry, I''m alive!'); println('So... somebody can give me a coffee?'); println('I know it''s Pascal, and not Java, but I love it :D.'); end;
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.