Examples of FontRenderer


Examples of net.minecraft.client.gui.FontRenderer

    publicStr = Lang.localize("gui.travelAccessable.public");
    privateStr = Lang.localize("gui.travelAccessable.private");
    protectedStr = Lang.localize("gui.travelAccessable.protected");

    FontRenderer fr = Minecraft.getMinecraft().fontRenderer;

    tf = new GuiTextField(fr, 7, 12, 90, 16);

    col1x = 88;
    col0x = (col1x - fr.getStringWidth(protectedStr) / 2) / 2;
    col2x = (col1x + fr.getStringWidth(protectedStr) / 2);
    col2x += (176 - col2x) / 2;

    int x = 0;
    int y = 50;
View Full Code Here

Examples of net.minecraft.client.gui.FontRenderer

    int col = ColorUtil.getRGB(Color.white);
    int x = sx;
    int y = sy + 38;

    FontRenderer fontRenderer = getFontRenderer();
    x = sx + col0x - fontRenderer.getStringWidth(privateStr) / 2;
    fontRenderer.drawStringWithShadow(privateStr, x, y, col);

    x = sx + col1x - fontRenderer.getStringWidth(protectedStr) / 2;
    fontRenderer.drawStringWithShadow(protectedStr, x, y, col);

    x = sx + col2x - fontRenderer.getStringWidth(publicStr) / 2;
    fontRenderer.drawStringWithShadow(publicStr, x, y, col);

    tf.drawTextBox();
    checkLabelForChange();

  }
View Full Code Here

Examples of net.minecraft.client.gui.FontRenderer

      Icon fluidIcon = fluid.getFlowingIcon();

      GL11.glPushMatrix();
      GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);

      FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
      ForgeDirection d = ForgeDirection.getOrientation(tileentity.blockMetadata);
      GL11.glTranslated(x + 0.5D, y + 0.5D, z + 0.5D);
      GL11.glTranslated(d.offsetX * 0.76D, d.offsetY * 0.76D, d.offsetZ * 0.76D);
      if (d == ForgeDirection.UP)
      {
        GL11.glScalef(1.0F, -1.0F, 1.0F);
        GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
      }

      if (d == ForgeDirection.DOWN)
      {
        GL11.glScalef(1.0F, -1.0F, 1.0F);
        GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F);
      }

      if (d == ForgeDirection.EAST)
      {
        GL11.glScalef(-1.0F, -1.0F, -1.0F);
        GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
      }

      if (d == ForgeDirection.WEST)
      {
        GL11.glScalef(-1.0F, -1.0F, -1.0F);
        GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
      }

      if (d == ForgeDirection.NORTH)
      {
        GL11.glScalef(-1.0F, -1.0F, -1.0F);
      }

      if (d == ForgeDirection.SOUTH)
      {
        GL11.glScalef(-1.0F, -1.0F, -1.0F);
        GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
      }

      GL11.glTranslatef(0.01F, 0.13F, -0.24F);
      GL11.glScalef(0.0625F * 0.25F, 0.0625F * 0.25F, 0.01612903F);

      long qty = ((TileEntityMonitorStorageFluid) tileentity).getAmount();
      if (qty > 999999999999L)
      {
        qty = 999999999999L;
      }
      String msg = Long.toString(qty) + "mB";
      if (Extracells.shortenedBuckets)
      {
        if (qty > 1000000000L)
          msg = Long.toString(qty / 1000000000L) + "MegaB";
        else if (qty > 1000000L)
          msg = Long.toString(qty / 1000000L) + "KiloB";
        else if (qty > 9999L)
        {
          msg = Long.toString(qty / 1000L) + "B";
        }
      }

      TileEntityMonitorStorageFluid TE = (TileEntityMonitorStorageFluid) tileentity;
      if (TE.isMachineActive())
      {
        GL11.glTranslated(-8.6F, -16.3, -1.2F);
        Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
        Tessellator cake = Tessellator.instance;
        cake.startDrawingQuads();
        cake.setBrightness(255);
        cake.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f);
        cake.addVertexWithUV(0, 16, 0, fluidIcon.getMinU(), fluidIcon.getMaxV());
        cake.addVertexWithUV(16, 16, 0, fluidIcon.getMaxU(), fluidIcon.getMaxV());
        cake.addVertexWithUV(16, 0, 0, fluidIcon.getMaxU(), fluidIcon.getMinV());
        cake.addVertexWithUV(0, 0, 0, fluidIcon.getMinU(), fluidIcon.getMinV());
        cake.draw();

        int width = fr.getStringWidth(msg);
        GL11.glTranslatef(8.25F - 0.5F * width, 24.0F, 0);
        GL11.glScaled(1, 0.5, 1);
        fr.drawString(msg, 0, 0, 0x00FFFF);
      }
      GL11.glPopMatrix();
      GL11.glPopAttrib();
    }
  }
View Full Code Here

Examples of net.minecraft.client.gui.FontRenderer

    int sx = (width - xSize) / 2;
    int sy = (height - ySize) / 2;

    drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize);

    FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
   
    GL11.glEnable(GL11.GL_BLEND);   
    fr.drawString("SW", sx + 55, sy + 41, ColorUtil.getARGB(1f,1f,0.35f,1f), true);   
    fr.drawString("NW", sx + 55, sy + 59, ColorUtil.getARGB(1f,1f,0.35f,1f), true);
    fr.drawString("SE", sx + 73, sy + 41, ColorUtil.getARGB(1f,1f,0.35f,1f), true);
    fr.drawString("NE", sx + 73, sy + 59, ColorUtil.getARGB(1f,1f,0.35f,1f), true);       
    GL11.glDisable(GL11.GL_BLEND);
   
    RenderUtil.bindTexture("enderio:textures/gui/farmStation.png");
    super.drawGuiContainerBackgroundLayer(par1, par2, par3);
  }
View Full Code Here

Examples of net.minecraft.client.gui.FontRenderer

      drawTexturedModalRect(sx + 80, sy + 65 - scaled, 176, 12 - scaled, 14, scaled + 2);
    }

    super.drawGuiContainerBackgroundLayer(par1, par2, par3);

    FontRenderer fr = getFontRenderer();
    int y = guiTop + fr.FONT_HEIGHT / 2 + 3;

    int output = 0;
    if(entity.isActive()) {
      output = entity.getPowerUsePerTick();
    }
    String txt =  Lang.localize("stirlingGenerator.output") + " " + PowerDisplayUtil.formatPower(output) + " " + PowerDisplayUtil.abrevation() + PowerDisplayUtil.perTickStr();
    int sw = fr.getStringWidth(txt);
    fr.drawStringWithShadow(txt, guiLeft + xSize / 2 - sw / 2, y, ColorUtil.getRGB(Color.WHITE));

    txt =  Lang.localize("stirlingGenerator.burnRate") + " " + (entity.getBurnTimeMultiplier()) + "x";
    sw = fr.getStringWidth(txt);
    y += fr.FONT_HEIGHT + 3;
    fr.drawStringWithShadow(txt, guiLeft + xSize / 2 - sw / 2, y, ColorUtil.getRGB(Color.WHITE));

  }
View Full Code Here

Examples of net.minecraft.client.gui.FontRenderer

    int sx = (width - xSize) / 2;
    int sy = (height - ySize) / 2;
    drawTexturedModalRect(sx, sy, 0, 0, xSize, ySize);
    int scaled;

    FontRenderer fr = getFontRenderer();
    int output = 0;
    if(gen.isActive()) {
      output = gen.outputPerTick;
    }
    String txt =  Lang.localize("combustionGenerator.output") + " " + PowerDisplayUtil.formatPower(output) + " " + PowerDisplayUtil.abrevation() + PowerDisplayUtil.perTickStr();
    int sw = fr.getStringWidth(txt);
    fr.drawStringWithShadow(txt, guiLeft + xSize / 2 - sw / 2, guiTop + fr.FONT_HEIGHT / 2 + 3, ColorUtil.getRGB(Color.WHITE));

    int x = guiLeft + 80;
    int y = guiTop + 21;   
    if(gen.fuelTank.getFluidAmount() > 0) {
   
      RenderUtil.renderGuiTank(gen.fuelTank.getFluid(), gen.fuelTank.getCapacity(), gen.fuelTank.getFluidAmount(), x, y, zLevel, 15, 47);

      if(gen.isActive()) {
        txt = gen.tickPerBucketOfFuel / 1000 + " t/Mb";
        sw = fr.getStringWidth(txt);
        fr.drawStringWithShadow(txt, x - sw / 2 + 7, y + fr.FONT_HEIGHT / 2 + 46, ColorUtil.getRGB(Color.WHITE));
      }     
    }

    RenderUtil.bindTexture("enderio:textures/gui/zombieGenerator.png");
    super.drawGuiContainerBackgroundLayer(par1, par2, par3);
View Full Code Here

Examples of net.minecraft.client.gui.FontRenderer

   
    invRoot = container.getItemInventoryOffset();
    parent.drawTexturedModalRect(left + invRoot.x - 1, top + invRoot.y - 1, 24, 180, 72, 36);
    parent.drawTexturedModalRect(left + invRoot.x - 1 + (18 * 4) + container.getItemBufferSpacing(), top + invRoot.y - 1, 24, 180, 72, 36);
           
    FontRenderer fr = parent.getFontRenderer();
    String sendTxt = "Send";   
    int x = left + invRoot.x + 36 - fr.getStringWidth(sendTxt)/2;
    int y = top + invRoot.y - fr.FONT_HEIGHT - 3;
    fr.drawString(sendTxt, x, y, ColorUtil.getRGB(Color.BLACK));
    String recText = "Receive";
    x = left + invRoot.x + 72 + container.getItemBufferSpacing() + 36 - fr.getStringWidth(recText)/2;
    fr.drawString(recText, x, y, ColorUtil.getRGB(Color.BLACK));
   
    //Highlights
    parent.renderSlotHighlights();   
   
    //Power   
View Full Code Here

Examples of net.minecraft.client.gui.FontRenderer

    configB.onGuiInit();

    int x = guiLeft + xSize - rightMargin - GuiMachineBase.BUTTON_SIZE;
    int y = guiTop + inputY;

    FontRenderer fontRenderer = getFontRenderer();

    inputRsButton.onGuiInit();
    outputRsButton.onGuiInit();

    x = guiLeft + inputX;
View Full Code Here

Examples of net.minecraft.client.gui.FontRenderer

    int midX = sx + xSize / 2;

    String str = Lang.localize("gui.capBank.maxIo") + " " + PowerDisplayUtil.formatPower(capBank.getMaxIO()) +
        " " + PowerDisplayUtil.abrevation() + PowerDisplayUtil.perTickStr();
    FontRenderer fontRenderer = getFontRenderer();
    int swid = fontRenderer.getStringWidth(str);
    int x = midX - swid / 2;
    int y = guiTop + 5;

    drawString(fontRenderer, str, x, y, -1);

    str = Lang.localize("gui.capBank.maxInput") + ":";
    swid = fontRenderer.getStringWidth(str);
    x = guiLeft + inputX - swid - 3;
    y = guiTop + inputY + 2;
    drawString(fontRenderer, str, x, y, -1);

    str = Lang.localize("gui.capBank.maxOutput") + ":";
    swid = fontRenderer.getStringWidth(str);
    x = guiLeft + outputX - swid - 3;
    y = guiTop + outputY + 2;
    drawString(fontRenderer, str, x, y, -1);

  }
View Full Code Here

Examples of net.minecraft.client.gui.FontRenderer

    int sx = (width - xSize) / 2;
    int sy = (height - ySize) / 2;
    drawTexturedModalRect(sx, sy, 0, 0, xSize, ySize);
    int scaled;

    FontRenderer fr = getFontRenderer();
    int output = 0;
    if(gen.isActive()) {     
      output = gen.getGeneratedLastTick();
    }
    String txt =  Lang.localize("combustionGenerator.output") + " " + PowerDisplayUtil.formatPower(output) + " " + PowerDisplayUtil.abrevation() + PowerDisplayUtil.perTickStr();
    int sw = fr.getStringWidth(txt);
    fr.drawStringWithShadow(txt, guiLeft + xSize / 2 - sw / 2, guiTop + fr.FONT_HEIGHT / 2 + 3, ColorUtil.getRGB(Color.WHITE));

    int x = guiLeft + 48;
    int y = guiTop + 21;
    if(gen.getCoolantTank().getFluidAmount() > 0) {
      x = guiLeft + 114;
      //right tank
      RenderUtil.renderGuiTank(gen.getCoolantTank().getFluid(), 4000, gen.getCoolantTank().getFluidAmount() - 1000, x, y, zLevel, 15, 47);

      if(gen.isActive()) {
        txt = gen.getNumTicksPerMbCoolant() + " t/MB";
        sw = fr.getStringWidth(txt);
        fr.drawStringWithShadow(txt, x - sw / 2 + 7, y + fr.FONT_HEIGHT / 2 + 47, ColorUtil.getRGB(Color.WHITE));
      }

      x = guiLeft + 72;
      y = guiTop + 14;
      //center coolant chamber
      RenderUtil.renderGuiTank(gen.getCoolantTank().getFluid(), 1000, Math.min(gen.getCoolantTank().getFluidAmount(), 1000), x, y, zLevel, 33, 33);
      //draw some gui over the top again to make the center shape
      RenderUtil.bindTexture("enderio:textures/gui/combustionGen.png");
      drawTexturedModalRect(x, y + 14, 0, 223, 33, 33);
      y += 7;
    }

    if(gen.getFuelTank().getFluidAmount() > 0) {
      //left tank
      x = guiLeft + 48;

      //RenderUtil.renderGuiTank(gen.fuelTank.getFluid(), 4000, gen.fuelTank.getFluidAmount() - 1000, x, y, zLevel, 15, 47);
      RenderUtil.renderGuiTank(gen.getFuelTank().getFluid(), 4000, gen.getFuelTank().getFluidAmount() - 1000, x, y, zLevel, 15, 47);

      if(gen.isActive()) {
        txt = gen.getNumTicksPerMbFuel() + " t/MB";
        sw = fr.getStringWidth(txt);
        fr.drawStringWithShadow(txt, x - sw / 2 + 7, y + fr.FONT_HEIGHT / 2 + 47, ColorUtil.getRGB(Color.WHITE));
      }

      //center tank
      //RenderUtil.renderGuiTank(gen.fuelTank.getFluid(), 1000, Math.min(gen.fuelTank.getFluidAmount(), 1000), guiLeft + 81, guiTop + 5, zLevel, 14, 14);
      RenderUtil.renderGuiTank(gen.getFuelTank().getFluid(), 1000, Math.min(gen.getFuelTank().getFluidAmount(), 1000), guiLeft + 81, guiTop + 5, zLevel, 14, 14);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.