use of net.minecraft.client.gui.GuiTextField in project Railcraft by Railcraft.
the class GuiBoxAnalogController method initGui.
@Override
public void initGui() {
if (tile == null)
return;
int w = (width - xSize) / 2;
int h = (height - ySize) / 2;
for (Map.Entry<SignalAspect, BitSet> entry : aspects.entrySet()) {
GuiTextField textField = new GuiTextField(entry.getKey().ordinal(), fontRendererObj, w + 72, h + getYPosFromIndex(entry.getKey().ordinal()), 95, 10);
textField.setMaxStringLength(37);
textField.setText(rangeToString(entry.getValue()));
textBox.put(entry.getKey(), textField);
}
}
use of net.minecraft.client.gui.GuiTextField in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class HovercraftControllerGUI method keyTyped.
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
boolean typed = false;
for (GuiTextField text : textFields) {
typed = typed || text.textboxKeyTyped(typedChar, keyCode);
}
if (!typed) {
updateServer();
super.keyTyped(typedChar, keyCode);
}
}
use of net.minecraft.client.gui.GuiTextField in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class HovercraftControllerGUI method initGui.
@Override
public void initGui() {
super.initGui();
this.mc.thePlayer.openContainer = this.inventorySlots;
this.guiLeft = (this.width - this.xSize) / 2;
this.guiTop = (this.height - this.ySize) / 2;
textFields.clear();
int fieldWidth = 40;
int fieldHeight = 20;
GuiTextField top = new GuiTextField(0, fontRendererObj, (width - fieldWidth) / 2 - 61, (height - fieldHeight) / 2 - 77, fieldWidth, fieldHeight);
GuiTextField mid = new GuiTextField(0, fontRendererObj, (width - fieldWidth) / 2 - 57, (height - fieldHeight) / 2 - 49, fieldWidth, fieldHeight);
GuiTextField bot = new GuiTextField(0, fontRendererObj, (width - fieldWidth) / 2 - 57, (height - fieldHeight) / 2 - 20, fieldWidth, fieldHeight);
top.setEnableBackgroundDrawing(false);
mid.setEnableBackgroundDrawing(false);
bot.setEnableBackgroundDrawing(false);
textFields.add(top);
textFields.add(mid);
textFields.add(bot);
updateTextFields();
// buttonList.add(new GuiButton(1, width/2-100, height/2-24, "Bastard button"));
}
Aggregations