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 have a gui with a text field, but I can't sellect it to type in it.  I can make it sellected when you open the gui, but I can't sellect it in the gui.

 

Gui:

 

 

package Technomage3.both.Interfaces.guis;

import java.util.ArrayList;

import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;

import am2.api.spell.component.interfaces.ISpellPart;
import am2.api.spell.component.interfaces.ISpellShape;
import am2.containers.ContainerInscriptionTable;
import Technomage3.both.Interfaces.containers.ContainerItemTransferNetworkBase;
import Technomage3.both.ItemTransfer.tileentities.TileEntityItemTransferNetworkBase;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;

public class GuiItemTransferNetworkBase extends GuiContainer {

private static final ResourceLocation tex = new ResourceLocation("tn3", "textures/gui/itemTransfer/base.png");

private GuiTextField name;
private ContainerItemTransferNetworkBase cont;

public GuiItemTransferNetworkBase(TileEntityItemTransferNetworkBase tile, EntityPlayer player) {
	super(new ContainerItemTransferNetworkBase(tile, player));
	xSize = 176;
	ySize = 130;
	cont = (ContainerItemTransferNetworkBase) super.inventorySlots;
}

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {

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

	super.mc.renderEngine.bindTexture(tex);

	drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize);

}

public void initGui(){
	super.initGui();

	name = new GuiTextField(this.fontRenderer, 50, 19, 72, 12);
	name.setText(cont.name);
	name.setFocused(true);

}

protected void drawGuiContainerForegroundLayer(int par1, int par2)
    {
        name.drawTextBox();
    }

protected void keyTyped(char par1, int par2)
{
	if (this.name.textboxKeyTyped(par1, par2))
	{
		cont.setName(name.getText());
	}
	else
	{
		super.keyTyped(par1, par2);
	}
}
protected void mouseClicked(int par1, int par2, int par3)
    {
        super.mouseClicked(par1, par2, par3);
        this.name.mouseClicked(par1, par2, par3);
    }

public void updateScreen()
    {
        this.name.updateCursorCounter();
    }

    
}

 

 

  • Author

BUMP! Help please!

 

I need to be able to click on the tet bar in the gui to make it "focused" so I can type in it.

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.