Jump to content

Recommended Posts

Posted (edited)

I'm having problems knowing what else I should do in order to let JEI know that my GUI is wider so it knows not to render on top.

 

XiVm7Lf.png

 

The GUI Code:

public class GuiFactory extends GuiContainer {

    protected int xSize = 256;
    protected int ySize = 220;

    private static final ResourceLocation FACTORY_GUI_BACKGROUND = new ResourceLocation(ModInfo.MODID + ":textures/gui/container/factory_base.png");

    public GuiFactory(Container inventorySlotsIn) {
        super(inventorySlotsIn);
    }

    /**
     * Draws the screen and all the components in it.
     */
    @Override
    public void drawScreen(int par1, int par2, float par3) {
        this.drawDefaultBackground(); // This makes the background go darker
        super.drawScreen(par1, par2, par3);
    }

    /**
     * Draw the background layer for the GuiContainer (everything behind the items)
     */
    @Override
    protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.getTextureManager().bindTexture(FACTORY_GUI_BACKGROUND);
        int k = (this.width - this.xSize) / 2;
        int l = (this.height - this.ySize) / 2;
        this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
        int i1;
    }

    /**
     * Draw the foreground layer for the GuiContainer (everything in front of the
     * items)
     */
    @Override
    protected void drawGuiContainerForegroundLayer(int par1, int par2) {
        this.fontRenderer.drawString(I18n.format("container.inventory"), -26, this.ySize - 122, 4210752);
    }

}

 

Edited by American2050

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.