本文整理汇总了Java中cpw.mods.fml.client.config.GuiCheckBox类的典型用法代码示例。如果您正苦于以下问题:Java GuiCheckBox类的具体用法?Java GuiCheckBox怎么用?Java GuiCheckBox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GuiCheckBox类属于cpw.mods.fml.client.config包,在下文中一共展示了GuiCheckBox类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initGui
import cpw.mods.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
public void initGui()
{
int yBase = this.height / 2 - (106 / 2);
connectButton = new GuiButton(0, width / 2 - 40, this.height - 30, 80, 20, I18n.format("creeperhost.multiplayer.connect"));
if (canConnect)
{
buttonList.add(connectButton);
}
cancelButton = new GuiButton(1, width - 100, this.height - 30, 80, 20, I18n.format("creeperhost.multiplayer.cancel"));
buttonList.add(cancelButton);
String checkText = I18n.format("creeperhost.multiplayer.addlist");
int checkWidth = 11 + 2 + fontRendererObj.getStringWidth(checkText);
checkBox = new GuiCheckBox(2, (width / 2) - (checkWidth / 2), yBase + 36 + 30 + 30, checkText, addToServerList);
buttonList.add(checkBox);
}
示例2: initGui
import cpw.mods.fml.client.config.GuiCheckBox; //导入依赖的package包/类
@Override
public void initGui()
{
super.initGui();
int halfWidth = this.width / 2;
int halfHeight = this.height / 2;
this.nameField = new GuiTextFieldValidate(this.fontRendererObj, halfWidth - 100, halfHeight - 50, 200, 20, "([A-Za-z0-9]*)");
this.nameField.setMaxStringLength(Constants.MAX_SERVER_NAME_LENGTH);
this.nameField.setText(this.order.name.isEmpty() ? Util.getDefaultName() : this.order.name);
this.order.name = this.nameField.getText().trim();
String checkboxString = Util.localize("info.pregen");
int checkboxWidth = this.fontRendererObj.getStringWidth(checkboxString) + 11 + 2;
pregen = new GuiCheckBox(3, halfWidth - (checkboxWidth / 2), halfHeight - 8, checkboxString, order.pregen);
if (Config.getInstance().getPregenDiameter() > 0)
{
this.buttonList.add(pregen);
}
final Order orderTemp = this.order;
this.slotSlider = new GuiSlider(0, halfWidth - 100, halfHeight + 15, 150, 20, Util.localize("slider.player_count") + ": ", "", Constants.MIN_PLAYER_COUNT, Constants.MAX_PLAYER_COUNT, this.order.playerAmount, false, true, new GuiSlider.ISlider()
{
@Override
public void onChangeSliderValue(GuiSlider slider)
{
orderTemp.playerAmount = slider.getValueInt();
}
});
this.slotSlider.width = 200;
this.buttonList.add(this.slotSlider);
}