本文整理匯總了Java中net.minecraft.client.gui.GuiTextField.setText方法的典型用法代碼示例。如果您正苦於以下問題:Java GuiTextField.setText方法的具體用法?Java GuiTextField.setText怎麽用?Java GuiTextField.setText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.gui.GuiTextField
的用法示例。
在下文中一共展示了GuiTextField.setText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui()
{
// xSize = 93;
// ySize = 75;
Keyboard.enableRepeatEvents(true);
this.guiLeft = (this.width - this.xSize) / 2;
this.guiTop = (this.height - this.ySize) / 2;
channelName = new GuiTextField(0, mc.fontRenderer, this.guiLeft + 7, this.guiTop + 17, 80, mc.fontRenderer.FONT_HEIGHT + 4);
channelName.setMaxStringLength(15);
channelName.setTextColor(16777215);
channelName.setText(terminal.channelName.isEmpty() ? "" : terminal.channelName.substring(terminal.channelName.indexOf(":") + 1));
isPublicChannel = !terminal.channelName.isEmpty() && terminal.channelName.contains("public");
buttonList.clear();
buttonList.add(new GuiButton(ID_CONFIRM, guiLeft + (xSize - 50) / 2, guiTop + ySize + 2, 50, 20, I18n.translateToLocal("gui.done")));
buttonList.add(new GuiButton(ID_PUBLIC_CHANNEL, guiLeft + 6, guiTop + 47, 82, 20, I18n.translateToLocal(isPublicChannel ? "gui.yes" : "gui.no")));
}
示例2: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui()
{
buttonList.add(new GuiButton(0, width / 2 - 100, 60, "Change Key"));
buttonList
.add(new GuiButton(1, width / 2 - 100, height / 4 + 72, "Save"));
buttonList
.add(new GuiButton(2, width / 2 - 100, height / 4 + 96, "Cancel"));
commandField =
new GuiTextField(0, fontRendererObj, width / 2 - 100, 100, 200, 20);
commandField.setMaxStringLength(65536);
commandField.setFocused(true);
if(oldCommands != null)
commandField.setText(oldCommands);
}
示例3: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui()
{
Keyboard.enableRepeatEvents(true);
buttonList.add(
new GuiButton(0, width / 2 - 100, height / 3 * 2, 200, 20, "Done"));
buttonList.add(new GuiButton(1, width / 2 - 100, height / 3 * 2 + 24,
200, 20, "Cancel"));
commandBox =
new GuiTextField(0, fontRendererObj, width / 2 - 100, 60, 200, 20);
commandBox.setMaxStringLength(100);
commandBox.setFocused(true);
commandBox.setText("/");
}
示例4: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public final void initGui()
{
Keyboard.enableRepeatEvents(true);
buttonList.add(doneButton = new GuiButton(0, width / 2 - 100,
height / 4 + 72 + 12, getDoneButtonText()));
buttonList.add(
new GuiButton(1, width / 2 - 100, height / 4 + 120 + 12, "Cancel"));
buttonList.add(new GuiButton(3, width / 2 - 100, height / 4 + 96 + 12,
"Random Name"));
buttonList.add(stealSkinButton =
new GuiButton(4, width - (width / 2 - 100) / 2 - 64, height - 32,
128, 20, "Steal Skin"));
buttonList.add(new GuiButton(5, (width / 2 - 100) / 2 - 64, height - 32,
128, 20, "Open Skin Folder"));
emailBox =
new GuiTextField(0, fontRendererObj, width / 2 - 100, 60, 200, 20);
emailBox.setMaxStringLength(48);
emailBox.setFocused(true);
emailBox.setText(getDefaultEmail());
passwordBox =
new PasswordField(fontRendererObj, width / 2 - 100, 100, 200, 20);
passwordBox.setFocused(false);
passwordBox.setText(getDefaultPassword());
}
示例5: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui() {
ySize = 176;
xSize = 210;
labelList.clear();
super.initGui();
fieldName = new GuiTextField(0, fontRenderer, guiLeft + 6, guiTop + 6, 50, 10);
fieldName.setMaxStringLength(30);
fieldName.setTextColor(0xffffff);
TomsModUtils.addTextFieldToLabelList(fieldName, labelList);
if (entry != null)
fieldName.setText(entry.getName());
offsetX = new GuiNumberValueBox(0, guiLeft + 5, guiTop + 20, 32, -32);
offsetY = new GuiNumberValueBox(1, guiLeft + 5, guiTop + 30, 32, -32);
offsetZ = new GuiNumberValueBox(2, guiLeft + 5, guiTop + 40, 32, -32);
offsetX.addToList(buttonList);
offsetY.addToList(buttonList);
offsetZ.addToList(buttonList);
offsetX.num = entry.getOffsetX();
offsetY.num = entry.getOffsetY();
offsetZ.num = entry.getOffsetZ();
TomsModUtils.addNumberValueBoxToLabelList(offsetX, labelList);
TomsModUtils.addNumberValueBoxToLabelList(offsetY, labelList);
TomsModUtils.addNumberValueBoxToLabelList(offsetZ, labelList);
}
示例6: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui() {
Keyboard.enableRepeatEvents(true);
accountsgui = new GuiAccountSelector.List(this.mc);
accountsgui.registerScrollButtons(5, 6);
query = I18n.format("ias.search");
this.buttonList.clear();
//Above Top Row
this.buttonList.add(reloadskins = new GuiButton(8, this.width / 2 - 154 - 10, this.height - 76 - 8, 120, 20, I18n.format("ias.reloadskins")));
//Top Row
this.buttonList.add(new GuiButton(0, this.width / 2 + 4 + 40, this.height - 52, 120, 20, I18n.format("ias.addaccount")));
this.buttonList.add(login = new GuiButton(1, this.width / 2 - 154 - 10, this.height - 52, 120, 20, I18n.format("ias.login")));
this.buttonList.add(edit = new GuiButton(7, this.width / 2 - 40, this.height - 52, 80, 20, I18n.format("ias.edit")));
//Bottom Row
this.buttonList.add(loginoffline = new GuiButton(2, this.width / 2 - 154 - 10, this.height - 28, 110, 20, I18n.format("ias.login") + " " + I18n.format("ias.offline")));
this.buttonList.add(new GuiButton(3, this.width / 2 + 4 + 50, this.height - 28, 110, 20, I18n.format("gui.cancel")));
this.buttonList.add(delete = new GuiButton(4, this.width / 2 - 50, this.height - 28, 100, 20, I18n.format("ias.delete")));
search = new GuiTextField(8, this.fontRenderer, this.width / 2 - 80, 14, 160, 16);
search.setText(query);
updateButtons();
if (!queriedaccounts.isEmpty())
SkinTools.buildSkin(queriedaccounts.get(selectedAccountIndex).alias);
}
開發者ID:The-Fireplace-Minecraft-Mods,項目名稱:In-Game-Account-Switcher,代碼行數:24,代碼來源:GuiAccountSelector.java
示例7: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
/**
* Adds the buttons (and other controls) to the screen in question.
*/
@SuppressWarnings("unchecked")
@Override
public void initGui() {
Keyboard.enableRepeatEvents(true);
buttonList.clear();
buttonList.add(new GuiButton(0, width / 2 - 100, height / 4 + 96 + 12, "Search"));
buttonList.add(new GuiButton(1, width / 2 - 100, height / 4 + 120 + 12, "Back"));
ipBox = new GuiTextField(0, fontRendererObj, width / 2 - 100, height / 4 + 34, 200, 20);
ipBox.setMaxStringLength(15);
ipBox.setFocused(true);
maxThreadsBox = new GuiTextField(1, fontRendererObj, width / 2 - 32, height / 4 + 58, 26, 12);
maxThreadsBox.setMaxStringLength(3);
maxThreadsBox.setFocused(false);
maxThreadsBox.setText(Integer.toString(WurstClient.INSTANCE.options.serverFinderThreads));
running = false;
terminated = false;
WurstClient.INSTANCE.analytics.trackPageView("/multiplayer/server-finder", "Server Finder");
}
示例8: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui()
{
// Called when the gui should be (re)created
// Sidebar buttons for now
this.buttonList.add( new GuiButton( 100, (width / 2) + 78, height / 2 - 60, 120, 20, I18n.format("xray.single.delete") ));
this.buttonList.add( new GuiButton( 101, (width / 2) + 78, height / 2 - 38, 120, 20, I18n.format("xray.input.change_meta") ));
this.buttonList.add( new GuiButton( 98, (width / 2) + 78, height / 2 + 58, 120, 20, I18n.format("xray.single.save") ));
// Bottom buttons
this.buttonList.add( new GuiButton( 99, width / 2 - 138, height / 2 + 83, 202, 20, I18n.format("xray.single.cancel") ) ); // Cancel button
this.buttonList.add( redSlider = new GuiSlider( 3, width / 2 - 138, height / 2 + 7, I18n.format("xray.color.red"), 0, 255 ));
this.buttonList.add( greenSlider = new GuiSlider( 2, width / 2 - 138, height / 2 + 30, I18n.format("xray.color.green"), 0, 255 ));
this.buttonList.add( blueSlider = new GuiSlider( 1, width / 2 - 138, height / 2 + 53, I18n.format("xray.color.blue"), 0, 255 ) );
redSlider.sliderValue = (float)oreInfo.color[0]/255;
greenSlider.sliderValue = (float)oreInfo.color[1]/255;
blueSlider.sliderValue = (float)oreInfo.color[2]/255;
oreName = new GuiTextField( 1, this.fontRenderer, width / 2 - 138 , height / 2 - 63, 202, 20 );
oreName.setText(this.oreInfo.getDisplayName());
}
示例9: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui() {
// new GuiTextField(FontRenderer, x, y, width, height).
mCodenameField = new GuiTextField(this.fontRendererObj, (width - 200) / 2, 20, 200, 20);
mCodenameField.setFocused(true);
mCodenameField.setText("");
// new GuiButton(id, x, y, (width, height, )String).
mResistanceButton = new GuiButton(ID_RESISTANCE_BUTTON, (width - 200) / 2, height - 80 - 20, 200, 20, "RESISTANCE");
mEnlightenedButton = new GuiButton(ID_ENLIGHTENED_BUTTON, (width - 200) / 2, height - 60 - 10, 200, 20, "ENLIGHTENED");
mCancelButton = new GuiButton(ID_CANCEL_BUTTON, (width - 200) / 2, height - 40, 200, 20, "#你怎麽還在玩這個遊戲");
buttonList.add(mResistanceButton);
buttonList.add(mEnlightenedButton);
buttonList.add(mCancelButton);
}
示例10: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui() {
super.initGui();
infinite = tileEntity.infiniteMode;
infiniteButton = new GuiSlimButton(idInfiniteButton, 9 + (width - xSize) / 2, 54 + (height - ySize) / 2, 148,
12, infinite ? I18n.format("vendor.wrench.infiniteon") : I18n.format("vendor.wrench.infiniteoff"));
editButton = new GuiSlimButton(idEditButton, 68 + (width - xSize) / 2, 34 + (height - ySize) / 2, 40, 12,
I18n.format("general.button.edit"));
applyButton = new GuiSlimButton(idApplyButton, 110 + (width - xSize) / 2, 34 + (height - ySize) / 2, 40, 12,
I18n.format("general.button.save"));
buttonList.clear();
buttonList.add(editButton);
buttonList.add(applyButton);
buttonList.add(infiniteButton);
blockOwnerField = new GuiTextField(0, this.fontRenderer, 12, 20, 138, 13);
blockOwnerField.setFocused(false);
blockOwnerField.setMaxStringLength(100);
blockOwnerField.setText(tileEntity.blockOwner);
blockOwnerField.setEnableBackgroundDrawing(true);
}
示例11: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui() {
super.initGui();
buttonOne = new GuiSlimButton(idButtonOne, 8 + (width - xSize) / 2, 30 + (height - ySize) / 2, 18, 12, "");
buttonTwo = new GuiSlimButton(idButtonTwo, 8 + (width - xSize) / 2, 50 + (height - ySize) / 2, 18, 12, "");
buttonThree = new GuiSlimButton(idButtonThree, 8 + (width - xSize) / 2, 70 + (height - ySize) / 2, 18, 12, "");
buttonFour = new GuiSlimButton(idButtonFour, 8 + (width - xSize) / 2, 90 + (height - ySize) / 2, 18, 12, "");
buttonList.clear();
buttonList.add(buttonOne);
buttonList.add(buttonTwo);
buttonList.add(buttonThree);
buttonList.add(buttonFour);
textField = new GuiTextField(0, this.fontRenderer, 1, 1, 100, 13);
textField.setFocused(false);
textField.setMaxStringLength(9);
textField.setText("0");
}
示例12: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui() {
super.initGui();
text = new GuiTextField(getFontRenderer(), guiLeft + 7, guiTop + 18, 162, 20);
text.setText(ProxyClient.saveName);
text.setCursorPosition(0);
display = new ElementGlyphDisplay(this, 7, 52, ProxyClient.saveGlyph);
addElement(display);
buttonList.add(new GuiButton(0, guiLeft + 7, guiTop + ySize - 27, 80, 20, Localisation.get(EPMod.ID, Locale.GUI_CANCEL)));
buttonList.add(new GuiButton(1, guiLeft + xSize - 87, guiTop + ySize - 27, 80, 20, Localisation.get(EPMod.ID, Locale.GUI_SAVE)));
buttonList.add(new GuiButton(100, guiLeft + 57, guiTop + 83, 20, 20, ""));
buttonList.add(new GuiButton(101, guiLeft + xSize / 2 - 10, guiTop + 83, 20, 20, ""));
buttonList.add(new GuiButton(102, guiLeft + 99, guiTop + 83, 20, 20, ""));
}
示例13: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui() {
Keyboard.enableRepeatEvents(true);
super.initGui();
int width = 127, height = 20;
int x = (xSize / 2 - width / 2), y = 26 + (height / 2);
txtPassword = new GuiTextField(0, this.fontRenderer, x, y, width, height);
txtPassword.setMaxStringLength(40);
txtPassword.setText(ctr.tile.getMyPassword());
txtPassword.setFocused(true);
x = this.guiLeft - 82;
y = this.guiTop;
buttonActiveType = new ButtonPassword(PacketType.ACTIVETYPE, x, y);
this.addButton(buttonActiveType);
y += height + 4;
buttonUserClaim = new ButtonPassword(PacketType.USERCLAIM, x, y);
this.addButton(buttonUserClaim);
y += height + 4;
buttonUserPerm = new ButtonPassword(PacketType.USERSALLOWED, x, y);
this.addButton(buttonUserPerm);
updateVisibility();
}
示例14: EditableTeam
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
public EditableTeam(ScorePlayerTeam originalTeam) {
this.originalTeam = originalTeam;
nameTextField = new GuiTextField(0, Minecraft.getMinecraft().fontRendererObj, 80, 0, VIRTUAL_WIDTH / 2 - 70,
20);
nameTextField.setMaxStringLength(16);
if (originalTeam != null) {
nameTextField.setText(originalTeam.getRegisteredName());
}
displayNameTextField = new GuiTextField(0, Minecraft.getMinecraft().fontRendererObj, 80, 0,
VIRTUAL_WIDTH / 2 - 70, 20);
displayNameTextField.setMaxStringLength(32);
if (originalTeam != null) {
displayNameTextField.setText(originalTeam.getTeamName());
}
if (originalTeam == null) {
options = new TeamOptions();
} else {
options = new TeamOptions(originalTeam);
}
optionsButton = new GuiButton(0, VIRTUAL_WIDTH / 2 + 20, 0, VIRTUAL_WIDTH / 2 - 20, 20,
Translate.GUI_COMMANDEDITOR_SELECTTEAM_OPTIONS);
}
示例15: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui()
{
super.initGui();
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
buttonList.clear();
buttonList.add(new GuiButton(0, guiWidth + 27, guiHeight + 62, 60, 20, MekanismUtils.localize("gui.save")));
buttonList.add(new GuiButton(1, guiWidth + 89, guiHeight + 62, 60, 20, MekanismUtils.localize("gui.delete")));
if(isNew)
{
((GuiButton)buttonList.get(1)).enabled = false;
}
minField = new GuiTextField(fontRendererObj, guiWidth + 149, guiHeight + 19, 20, 11);
minField.setMaxStringLength(2);
minField.setText("" + filter.min);
maxField = new GuiTextField(fontRendererObj, guiWidth + 149, guiHeight + 31, 20, 11);
maxField.setMaxStringLength(2);
maxField.setText("" + filter.max);
}