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

I am using this to draw a string onto my GUI but it does not show up.

 

public void drawGuiConatinerForegroundLayer(int par1, int par2){
	//This gets the name so when we open the gui it says Grinder
	String name = "Grinder";

	//sets where it says Grinder
	this.fontRendererObj.drawString(name,80, 6, 4210752);

	//sets where it says Inventory
	this.fontRendererObj.drawString("Inventory", 128, this.ySize - 96 + 2, 4210752);
}

  • Author

Here ya go.

package com.wiffington.pizzeria.gui;

import org.lwjgl.opengl.GL11;

import com.wiffington.pizzeria.Main;
import com.wiffington.pizzeria.container.ContainerGrinder;
import com.wiffington.pizzeria.tileentity.TileEntityGrinder;

import javafx.scene.paint.Color;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;

public class GuiGrinder extends GuiContainer{

public static final ResourceLocation bground = new ResourceLocation(Main.MODID + ":"+"textures/gui/guiGrinder.png");

public TileEntityGrinder grinder;

public GuiGrinder(InventoryPlayer inventoryPlayer,TileEntityGrinder entity) {
	super(new ContainerGrinder(inventoryPlayer, entity));

	this.grinder = entity;

	//size of gui
	this.xSize = 176;
	this.ySize = 166;
}

public void drawGuiConatinerForegroundLayer(int par1, int par2){
	//This gets the name so when we open the gui it says Grinder
	String name = "Grinder";

	//sets where it says Grinder
	this.fontRendererObj.drawString(name,80, 6, 4210752);

	//sets where it says Inventory
	this.fontRendererObj.drawString("Inventory", 128, this.ySize - 96 + 2, 4210752);
}

@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
	GL11.glColor4f(1F, 1F, 1F, 1F);

	Minecraft.getMinecraft().getTextureManager().bindTexture(bground);
	drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);

	int k = (this.width - this.xSize) / 2;
	int l = (this.height - this.ySize) / 2;
	if(this.grinder.isPowered()){

		int k1 = this.grinder.getCookProgressScaled(24);
		System.out.println(k1);
		drawTexturedModalRect(guiLeft+79, guiTop+21, 176, 0, k1+1, 29);
	}


}

}

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.