本文整理匯總了Java中net.minecraft.client.gui.GuiTextField.setTextColor方法的典型用法代碼示例。如果您正苦於以下問題:Java GuiTextField.setTextColor方法的具體用法?Java GuiTextField.setTextColor怎麽用?Java GuiTextField.setTextColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.gui.GuiTextField
的用法示例。
在下文中一共展示了GuiTextField.setTextColor方法的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() {
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);
}
示例3: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui() {
this.xSize = 256;
this.ySize = 216;
labelList.clear();
super.initGui();
whiteListButton = new GuiButton(0, guiLeft + 10, guiTop + 72, 15, 20, "B");
buttonList.add(whiteListButton);
metaButton = new GuiButton(1, guiLeft + 25, guiTop + 72, 30, 20, TextFormatting.GREEN + "Meta");
buttonList.add(metaButton);
modButton = new GuiButton(2, guiLeft + 56, guiTop + 72, 30, 20, TextFormatting.RED + "Mod");
buttonList.add(modButton);
nbtButton = new GuiButton(3, guiLeft + 87, guiTop + 72, 30, 20, TextFormatting.GREEN + "NBT");
buttonList.add(nbtButton);
buttonSelection = new GuiButtonDefenseStationSelection(4, guiLeft + 5, guiTop + 25, te.config);
buttonList.add(buttonSelection);
buttonRedstone = new GuiButtonRedstoneMode(5, guiLeft + 202, guiTop + 7, te.rsMode);
buttonList.add(buttonRedstone);
playerButton = new GuiButton(6, guiLeft + 10, guiTop + 51, 50, 20, I18n.format("tomsmod.gui.generic"));
buttonList.add(playerButton);
fieldName = new GuiTextField(0, fontRenderer, guiLeft + 6, guiTop + 6, 126, 15);
fieldName.setMaxStringLength(30);
fieldName.setTextColor(0xffffff);
TomsModUtils.addTextFieldToLabelList(fieldName, labelList);
}
示例4: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui()
{
super.initGui();
Keyboard.enableRepeatEvents(true);
int i = (width - xSize) / 2;
int j = (height - ySize) / 2;
itemNameField = new GuiTextField(fontRendererObj, i + 62, j + 24, 103, 12);
itemNameField.setTextColor(-1);
itemNameField.setDisabledTextColour(-1);
itemNameField.setEnableBackgroundDrawing(false);
itemNameField.setMaxStringLength(30);
inventorySlots.removeCraftingFromCrafters(this);
inventorySlots.addCraftingToCrafters(this);
}
示例5: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui(){
super.initGui();
Keyboard.enableRepeatEvents(true);
buttonList.add(confirmButton = new GuiButton(0, width / 2 - 52, height / 2 + 52, 100, 20, ClientUtils.localize("gui.universalKeyChanger.confirm")));
confirmButton.enabled = false;
textboxNewPasscode = new GuiTextField(0, fontRendererObj, width / 2 - 57, height / 2 - 47, 110, 12);
textboxNewPasscode.setTextColor(-1);
textboxNewPasscode.setDisabledTextColour(-1);
textboxNewPasscode.setEnableBackgroundDrawing(true);
textboxNewPasscode.setMaxStringLength(20);
textboxConfirmPasscode = new GuiTextField(1, fontRendererObj, width / 2 - 57, height / 2 - 7, 110, 12);
textboxConfirmPasscode.setTextColor(-1);
textboxConfirmPasscode.setDisabledTextColour(-1);
textboxConfirmPasscode.setEnableBackgroundDrawing(true);
textboxConfirmPasscode.setMaxStringLength(20);
}
示例6: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui(){
super.initGui();
Keyboard.enableRepeatEvents(true);
buttonList.add(new GuiButton(0, width / 2 - 38, height / 2 + 30 + 10, 80, 20, "0"));
buttonList.add(new GuiButton(1, width / 2 - 38, height / 2 - 60 + 10, 20, 20, "1"));
buttonList.add(new GuiButton(2, width / 2 - 8, height / 2 - 60 + 10, 20, 20, "2"));
buttonList.add(new GuiButton(3, width / 2 + 22, height / 2 - 60 + 10, 20, 20, "3"));
buttonList.add(new GuiButton(4, width / 2 - 38, height / 2 - 30 + 10, 20, 20, "4"));
buttonList.add(new GuiButton(5, width / 2 - 8, height / 2 - 30 + 10, 20, 20, "5"));
buttonList.add(new GuiButton(6, width / 2 + 22, height / 2 - 30 + 10, 20, 20, "6"));
buttonList.add(new GuiButton(7, width / 2 - 38, height / 2 + 10, 20, 20, "7"));
buttonList.add(new GuiButton(8, width / 2 - 8, height / 2 + 10, 20, 20, "8"));
buttonList.add(new GuiButton(9, width / 2 + 22, height / 2 + 10, 20, 20, "9"));
buttonList.add(new GuiButton(10, width / 2 + 48, height / 2 + 30 + 10, 25, 20, "<-"));
keycodeTextbox = new GuiTextField(11, fontRendererObj, width / 2 - 37, height / 2 - 67, 77, 12);
keycodeTextbox.setTextColor(-1);
keycodeTextbox.setDisabledTextColour(-1);
keycodeTextbox.setEnableBackgroundDrawing(true);
keycodeTextbox.setMaxStringLength(11);
}
示例7: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui(){
super.initGui();
Keyboard.enableRepeatEvents(true);
buttonList.add(confirmButton = new GuiButton(0, width / 2 - 52, height / 2 + 52, 100, 20, StatCollector.translateToLocal("gui.universalKeyChanger.confirm")));
confirmButton.enabled = false;
textboxNewPasscode = new GuiTextField(0, fontRendererObj, width / 2 - 57, height / 2 - 47, 110, 12);
textboxNewPasscode.setTextColor(-1);
textboxNewPasscode.setDisabledTextColour(-1);
textboxNewPasscode.setEnableBackgroundDrawing(true);
textboxNewPasscode.setMaxStringLength(20);
textboxConfirmPasscode = new GuiTextField(1, fontRendererObj, width / 2 - 57, height / 2 - 7, 110, 12);
textboxConfirmPasscode.setTextColor(-1);
textboxConfirmPasscode.setDisabledTextColour(-1);
textboxConfirmPasscode.setEnableBackgroundDrawing(true);
textboxConfirmPasscode.setMaxStringLength(20);
}
示例8: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui(){
super.initGui();
Keyboard.enableRepeatEvents(true);
buttonList.add(new GuiButton(0, width / 2 - 38, height / 2 + 30 + 10, 80, 20, "0"));
buttonList.add(new GuiButton(1, width / 2 - 38, height / 2 - 60 + 10, 20, 20, "1"));
buttonList.add(new GuiButton(2, width / 2 - 8, height / 2 - 60 + 10, 20, 20, "2"));
buttonList.add(new GuiButton(3, width / 2 + 22, height / 2 - 60 + 10, 20, 20, "3"));
buttonList.add(new GuiButton(4, width / 2 - 38, height / 2 - 30 + 10, 20, 20, "4"));
buttonList.add(new GuiButton(5, width / 2 - 8, height / 2 - 30 + 10, 20, 20, "5"));
buttonList.add(new GuiButton(6, width / 2 + 22, height / 2 - 30 + 10, 20, 20, "6"));
buttonList.add(new GuiButton(7, width / 2 - 38, height / 2 + 10, 20, 20, "7"));
buttonList.add(new GuiButton(8, width / 2 - 8, height / 2 + 10, 20, 20, "8"));
buttonList.add(new GuiButton(9, width / 2 + 22, height / 2 + 10, 20, 20, "9"));
buttonList.add(new GuiButton(10, width / 2 + 48, height / 2 + 30 + 10, 25, 20, "<-"));
keycodeTextbox = new GuiTextField(fontRendererObj, width / 2 - 37, height / 2 - 67, 77, 12);
keycodeTextbox.setTextColor(-1);
keycodeTextbox.setDisabledTextColour(-1);
keycodeTextbox.setEnableBackgroundDrawing(true);
keycodeTextbox.setMaxStringLength(11);
}
示例9: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui(){
super.initGui();
Keyboard.enableRepeatEvents(true);
buttonList.add(confirmButton = new GuiButton(0, width / 2 - 52, height / 2 + 52, 100, 20, ClientUtils.localize("gui.universalKeyChanger.confirm")));
confirmButton.enabled = false;
textboxNewPasscode = new GuiTextField(0, fontRenderer, width / 2 - 57, height / 2 - 47, 110, 12);
textboxNewPasscode.setTextColor(-1);
textboxNewPasscode.setDisabledTextColour(-1);
textboxNewPasscode.setEnableBackgroundDrawing(true);
textboxNewPasscode.setMaxStringLength(20);
textboxConfirmPasscode = new GuiTextField(1, fontRenderer, width / 2 - 57, height / 2 - 7, 110, 12);
textboxConfirmPasscode.setTextColor(-1);
textboxConfirmPasscode.setDisabledTextColour(-1);
textboxConfirmPasscode.setEnableBackgroundDrawing(true);
textboxConfirmPasscode.setMaxStringLength(20);
}
示例10: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
/**
* Adds the buttons (and other controls) to the screen in question.
*/
@Override
public void initGui() {
super.initGui();
buttonList.clear();
Keyboard.enableRepeatEvents(true);
searchField = new GuiTextField(-1, fontRenderer, guiLeft + 20, guiTop + 36, 89, fontRenderer.FONT_HEIGHT);
searchField.setMaxStringLength(15);
searchField.setEnableBackgroundDrawing(true);
searchField.setVisible(true);
searchField.setFocused(true);
searchField.setTextColor(16777215);
updateCreativeSearch();
}
示例11: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui() {
labelList.clear();
super.initGui();
this.guiLeft = (this.width - xSize) / 2;
this.guiTop = (this.height - ySize) / 2;
buttonNext = new GuiButtonNext(0, guiLeft + 130, guiTop + 51, 30, 20, I18n.format("tomsmod.gui.next"), I18n.format("tomsmod.gui.start"));
buttonList.add(buttonNext);
up1 = new GuiButtonNum(1, guiLeft + 20, guiTop + 26, 1, 1, 20);
up10 = new GuiButtonNum(1, guiLeft + 45, guiTop + 26, 10, 16, 25);
up100 = new GuiButtonNum(1, guiLeft + 75, guiTop + 26, 100, 32, 30);
up1000 = new GuiButtonNum(1, guiLeft + 110, guiTop + 26, 1000, 64, 35);
down1 = new GuiButtonNum(1, guiLeft + 20, guiTop + 76, -1, -1, 20);
down10 = new GuiButtonNum(1, guiLeft + 45, guiTop + 76, -10, -16, 25);
down100 = new GuiButtonNum(1, guiLeft + 75, guiTop + 76, -100, -32, 30);
down1000 = new GuiButtonNum(1, guiLeft + 110, guiTop + 76, -1000, -64, 35);
buttonList.add(down1);
buttonList.add(down10);
buttonList.add(down100);
buttonList.add(down1000);
buttonList.add(up1);
buttonList.add(up10);
buttonList.add(up100);
buttonList.add(up1000);
numberField = new GuiTextField(1, mc.fontRenderer, guiLeft + 61, guiTop + 57, 59, 10);
numberField.setTextColor(0xFFFFFF);
numberField.setEnableBackgroundDrawing(false);
numberField.setText("1");
numberField.setCanLoseFocus(false);
numberField.setFocused(true);
numberField.setMaxStringLength(6);
TomsModUtils.addTextFieldToLabelList(numberField, labelList);
buttonBack = new GuiButtonHidden(2, guiLeft + 155, guiTop + 2, 18, 18);
buttonList.add(buttonBack);
}
示例12: makeField
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
GuiTextField makeField(int x, int y, int width, GuiTextField orig, int text_length) {
String text = orig == null ? "" : orig.getText();
int cornerX = (this.width - this.xSize) / 2;
int cornerY = (this.height - this.ySize) / 2;
GuiTextField ret = new GuiTextField(1337, this.fontRendererObj, cornerX + x, cornerY + y, width, 12);
ret.setTextColor(-1);
ret.setDisabledTextColour(-1);
ret.setEnableBackgroundDrawing(true);
ret.setMaxStringLength(text_length);
ret.setText(text);
return ret;
}
示例13: update
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void update(int xPos, int yPos, int width, int height) {
EasingType easing = EasingsFactory.getInstance().quadratic();
if (searching) {
int tick = Minecraft.getMinecraft().ingameGUI.getUpdateCounter() - searchTimer;
if (tick < 2)
yPos = (int) easing.in().ease(tick, yPos, 14, 2);
else
yPos += 14;
itemdash.height = height;
}
this.yPos = yPos;
if (itemdash.dirty) {
GuiTextField text = new GuiTextField(0, Minecraft.getMinecraft().fontRendererObj, xPos + 2, yPos - 14, width, 14);
if (search != null) {
text.setText(search.getText());
text.setCursorPosition(search.getCursorPosition());
text.setFocused(search.isFocused());
}
text.setTextColor(-1);
this.search = text;
}
search.xPosition = xPos;
search.yPosition = yPos - 14;
if (itemdash.dirty) {
updateItems(this.items);
this.arrangedIcons = arrangeItems(this.items);
scroll(0);
itemdash.dirty = false;
}
}
示例14: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
/** runs once every time the GUI is opened
*
*/
@Override
public void initGui(){
super.initGui();
RunesOfWizardry.networkWrapper.sendToServer(new DustDyeRequestUpdatePacket(PARENT.getPos()));
Keyboard.enableRepeatEvents(true);
//posX, posY defines the top left pixel of the gui display
int posX = (this.width - textureX) /2;
int posY = (this.height - textureY) /2;
//GuiTextField(fontrenderer, x, y, sizeX, sizeY)
//GuiTextField(int id, FontRenderer font, int xPos, int yPos, int width, int height)
//id is useless apparently
//here, 0,0 is the top left of the texture...
textColor = new GuiTextField(0, this.fontRenderer, 105, 14, 45, 12);
textColor.setMaxStringLength(6);
textColor.setEnableBackgroundDrawing(false);
textColor.setVisible(true);
textColor.setTextColor(16777215);
/*if the color from the TE is empty/default, translate it to use it as the text
* Doing it here instead of in the TE allows the 'Color' text to be localized when the GUI is opened, not only when the TE is placed
*/
String color= PARENT.getColorString();
if(color==null || color.equals("Color") || color.equals("")){
color= I18n.format(References.Lang.COLOR);
}
textColor.setText(color);
updateColor();
textColor.setFocused(true);
textColor.setCanLoseFocus(true);
//id, x, y, width, height, text
//note: height seems to need to be 20 to display full button texture
buttonList.add(new GuiButton(GUI_DYE_BUTTON,posX+99,posY+55,50,20,I18n.format(References.Lang.DYE)));
}
示例15: initGui
import net.minecraft.client.gui.GuiTextField; //導入方法依賴的package包/類
@Override
public void initGui(){
super.initGui();
Keyboard.enableRepeatEvents(true);
buttonList.add(saveAndContinueButton = new GuiButton(0, width / 2 - 48, height / 2 + 30 + 10, 100, 20, !flag ? ClientUtils.localize("gui.keycardSetup.save") : ClientUtils.localize("gui.password.invalidCode")));
keycodeTextbox = new GuiTextField(1, fontRendererObj, width / 2 - 37, height / 2 - 47, 77, 12);
keycodeTextbox.setTextColor(-1);
keycodeTextbox.setDisabledTextColour(-1);
keycodeTextbox.setEnableBackgroundDrawing(true);
keycodeTextbox.setMaxStringLength(11);
updateButtonText();
}