当前位置: 首页>>代码示例>>Java>>正文


Java GuiTextField.setTextColor方法代码示例

本文整理汇总了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")));
    }
 
开发者ID:iChun,项目名称:GeneralLaymansAestheticSpyingScreen,代码行数:23,代码来源:GuiChannelSetter.java

示例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);
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:26,代码来源:GuiProjectorLensConfigurationMain.java

示例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);
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:26,代码来源:GuiDefenseStation.java

示例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);
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:18,代码来源:GuiRobitRepair.java

示例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);

}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:23,代码来源:GuiKeyChanger.java

示例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);
}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:25,代码来源:GuiCheckPassword.java

示例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);

}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:23,代码来源:GuiKeyChanger.java

示例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);
}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:25,代码来源:GuiCheckPassword.java

示例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);

}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:23,代码来源:GuiKeyChanger.java

示例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();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:18,代码来源:GuiSearcher.java

示例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);
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:36,代码来源:GuiCraftingAmountSelection.java

示例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;
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:13,代码来源:GuiArtifactForge.java

示例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;
    }
}
 
开发者ID:MineLittlePony,项目名称:ItemDash,代码行数:37,代码来源:MainDash.java

示例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)));
}
 
开发者ID:Xilef11,项目名称:Runes-of-Wizardry,代码行数:37,代码来源:GuiDustDye.java

示例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();
}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:16,代码来源:GuiSetPassword.java


注:本文中的net.minecraft.client.gui.GuiTextField.setTextColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。