Package net.minecraft.client.gui

Examples of net.minecraft.client.gui.ScaledResolution


 
  public void renderPlayerDisplay(long renderTicks) {
    if(!displayRenderer()) return;
    Minecraft mc = FMLClientHandler.instance().getClient();
    if(displayCross) {
      ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
          int width = res.getScaledWidth();
          int height = res.getScaledHeight();
          if (GuiIngameForge.renderCrosshairs && mc.ingameGUI != null) {
            mc.renderEngine.bindTexture(TEXTURE);
            GL11.glColor4d(0.0D, 0.0D, 0.0D, 1.0D);
            GL11.glDisable(GL11.GL_BLEND);
            mc.ingameGUI.drawTexturedModalRect(width / 2 - 7, height / 2 - 7, 0, 0, 16, 16);
View Full Code Here


    int ppi = 0;
    int panelxSize = 20;
    int panelySize = 20;
    int x = 2;
    int y = 2;
    ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
        int scaleX = scaledresolution.getScaledWidth();
        int scaleY = scaledresolution.getScaledHeight();
        int mouseX = Mouse.getX() * scaleX / this.mc.displayWidth - left;
    int mouseY = scaleY - Mouse.getY() * scaleY / this.mc.displayHeight - top;

    GL11.glTranslatef(left, top, 0.0F);
   
View Full Code Here

    private static void renderHUDOverlayItem(Minecraft minecraft, EntityPlayer entityPlayer, ItemStack itemStack)
    {
        float overlayScale = 2f;
        float overlayOpacity = 1f;
        GL11.glPushMatrix();
        ScaledResolution sr = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
        GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
        GL11.glMatrixMode(GL11.GL_PROJECTION);
        GL11.glLoadIdentity();
        GL11.glOrtho(0.0D, sr.getScaledWidth_double(), sr.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D);
        GL11.glMatrixMode(GL11.GL_MODELVIEW);
        GL11.glLoadIdentity();
        GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
        GL11.glPushMatrix();
        RenderHelper.enableGUIStandardItemLighting();
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glEnable(GL11.GL_COLOR_MATERIAL);
        GL11.glEnable(GL11.GL_LIGHTING);
        int hudOverlayX = 0;
        int hudOverlayY = 0;

        hudOverlayX = (int) (sr.getScaledWidth() - 16 * overlayScale);
        hudOverlayY = (int) (sr.getScaledHeight() - 16 * overlayScale);

        RenderUtils.renderItemIntoGUI(minecraft.fontRenderer, itemStack, hudOverlayX, hudOverlayY, overlayOpacity, overlayScale, -90);

        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glPopMatrix();
View Full Code Here

    Minecraft mc = Minecraft.getMinecraft();
    FontRenderer fontRenderer = mc.fontRendererObj;
   
    String msgper = (int) Math.floor(this.doneValue * 100) + "%";
   
    ScaledResolution screenRes = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
   
    int scrWidth = screenRes.getScaledWidth();
    int scrHeight = screenRes.getScaledHeight();
   
    int uwidth = getWidthOf("_");
    int uposx = (scrWidth - uwidth) / 2 + getWidthOf(this.MESSAGE_TITLE) / 2;
   
    fontRenderer.drawStringWithShadow(this.MESSAGE_TITLE, uposx + uwidth * 2, scrHeight / 2, 0xffffff);
View Full Code Here

 
  @Override
  public void onFrame(float semi)
  {
    Minecraft mc = Minecraft.getMinecraft();
    int fac = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight).getScaleFactor();
   
    float scale = 1f / fac;
    GL11.glPushMatrix();
    GL11.glScalef(scale, scale, 1.0F);
   
View Full Code Here

  }
 
  private void debugScanWithSheet(final Sheet sheet, boolean isDeltaPass)
  {
    Minecraft mc = Minecraft.getMinecraft();
    int fac = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight).getScaleFactor();
   
    float scale = 1f / fac;
    GL11.glPushMatrix();
    GL11.glScalef(scale, scale, 1.0F);
   
View Full Code Here

  public void initGui()
  {
    final int _GAP = 2;
    final int _UNIT = 20;
   
    int h = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight).getScaledHeight();
    h = h - _UNIT - _GAP;
   
    this.buttonList.add(new GuiButton(200, _GAP, h, 70, _UNIT, "Close"));
    this.buttonList
      .add(new GuiButton(201, _GAP * 2 + 70, h, 70, _UNIT, ChatColorsSimple.COLOR_GOLD + "Use in OSD"));
View Full Code Here

  public void initGui()
  {
    final int _GAP = 2;
    final int _UNIT = 20;
   
    int h = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight).getScaledHeight();
    h = h - _UNIT - _GAP;
   
    this.buttonList.add(new GuiButton(200, _GAP, h, 70, _UNIT, "Close"));
  }
View Full Code Here

    // with a GUI mod (thanks Vazkii!)
    {
      if (event.type == ElementType.HEALTH) {
        updateCounter++;

        ScaledResolution scaledresolution = new ScaledResolution(this.mc,
            this.mc.displayWidth, this.mc.displayHeight);
        int scaledWidth = scaledresolution.getScaledWidth();
        int scaledHeight = scaledresolution.getScaledHeight();
        int xBasePos = scaledWidth / 2 - 91;
        int yBasePos = scaledHeight - 39;

        boolean highlight = mc.thePlayer.hurtResistantTime / 3 % 2 == 1;
View Full Code Here

        return fontRenderer.getStringWidth(EnumChatFormatting.getTextWithoutFormattingCodes(s));
    }

    public static Dimension displaySize() {
        Minecraft mc = Minecraft.getMinecraft();
        ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
        return new Dimension(res.getScaledWidth(), res.getScaledHeight());
    }
View Full Code Here

TOP

Related Classes of net.minecraft.client.gui.ScaledResolution

Copyright © 2018 www.massapicom. 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.