Ejemplo n.º 1
0
  /** Draws the screen and all the components in it. */
  @Override
  public void drawScreen(int mouseX, int mouseY, float par3) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(new ResourceLocation("playblock:textures/gui/projector_bg.png"));
    int left = (width - xSize) / 2;
    int top = (height - ySize) / 2;
    drawTexturedModalRect(left, top, 0, 0, xSize, ySize);
    uriField.drawTextBox();
    heightField.drawTextBox();
    widthField.drawTextBox();
    triggerRangeField.drawTextBox();
    fadeRangeField.drawTextBox();

    fontRendererObj.drawString(
        StringUtils.translate("options.url"), left + 10, top + 20, 0xff999999);
    fontRendererObj.drawString(
        StringUtils.translate("options.screenSize"), left + 10, top + 40, 0xff999999);
    fontRendererObj.drawString("x", left + 117, top + 40, 0xff999999);
    fontRendererObj.drawString(
        StringUtils.translate("options.turnOn"), left + 10, top + 60, 0xff999999);
    fontRendererObj.drawString(
        StringUtils.translate("options.blocksAway"), left + 117, top + 60, 0xff999999);
    fontRendererObj.drawString(
        StringUtils.translate("options.turnOff"), left + 10, top + 80, 0xff999999);
    fontRendererObj.drawString(
        StringUtils.translate("options.blocksAway"), left + 117, top + 80, 0xff999999);
    fontRendererObj.drawString("TEST VERSION - skcraft.com", left + 10, top + 132, 0xffffffff);

    super.drawScreen(mouseX, mouseY, par3);
  }
Ejemplo n.º 2
0
  /** Adds the buttons (and other controls) to the screen in question. */
  @Override
  public void initGui() {
    this.buttonList.clear();
    Keyboard.enableRepeatEvents(true);
    int left = (width - xSize) / 2;
    int top = (height - ySize) / 2;

    this.buttonList.add(
        applyButton =
            new GuiButton(0, left + 160, top + 125, 80, 20, StringUtils.translate("gui.done")));

    this.buttonList.add(clearUriButton = new GuiButton(1, left + 220, top + 14, 17, 20, "X"));

    uriField =
        new GuiTextField(
            this.fontRendererObj, left + 60, top + 17, 157, this.fontRendererObj.FONT_HEIGHT + 5);
    initTextField(uriField, 100, uri);

    heightField =
        new GuiTextField(
            this.fontRendererObj, left + 130, top + 37, 50, this.fontRendererObj.FONT_HEIGHT + 5);
    initTextField(heightField, 10, Float.toString(projectorHeight));

    widthField =
        new GuiTextField(
            this.fontRendererObj, left + 60, top + 37, 50, this.fontRendererObj.FONT_HEIGHT + 5);
    initTextField(widthField, 10, Float.toString(projectorWidth));

    triggerRangeField =
        new GuiTextField(
            this.fontRendererObj, left + 60, top + 57, 50, this.fontRendererObj.FONT_HEIGHT + 5);
    initTextField(triggerRangeField, 10, Float.toString(triggerRange));

    fadeRangeField =
        new GuiTextField(
            this.fontRendererObj, left + 60, top + 77, 50, this.fontRendererObj.FONT_HEIGHT + 5);
    initTextField(fadeRangeField, 10, Float.toString(fadeRange));
  }