Posted July 7, 201411 yr 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(); } }
July 9, 201411 yr 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.