public static int getARGB(float r, float g, float b, float a) { return getARGB((int) (a * 255), (int) (r * 255), (int) (g * 255), (int) (b * 255)); }
@Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; GlStateManager.enableAlpha(); drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize); bindGuiTexture(); super.drawGuiContainerBackgroundLayer(par1, par2, par3); FontRenderer fr = Minecraft.getMinecraft().fontRenderer; GlStateManager.disableDepth(); GlStateManager.enableBlend(); fr.drawString("SW", sx + 55, sy + 48, ColorUtil.getARGB(1f, 1f, 0.35f, 1f), true); fr.drawString("NW", sx + 55, sy + 66, ColorUtil.getARGB(1f, 1f, 0.35f, 1f), true); fr.drawString("SE", sx + 73, sy + 48, ColorUtil.getARGB(1f, 1f, 0.35f, 1f), true); fr.drawString("NE", sx + 73, sy + 66, ColorUtil.getARGB(1f, 1f, 0.35f, 1f), true); GlStateManager.disableBlend(); GlStateManager.enableDepth(); }
drawString(fontRenderer, blockName, scale * (p.x + BUTTON_WIDTH / 2 - textWidth / 2), scale * p.y, ColorUtil.getARGB(Color.gray)); GL11.glPopMatrix(); int y = height / 2 - BUTTON_HEIGHT * 3 - 5; drawString(fontRenderer, txt, x, y, ColorUtil.getARGB(Color.white)); x = width / 2 - (fontRenderer.getStringWidth(txt) / 2); y = height / 2 + BUTTON_HEIGHT * 3 - 5; drawString(fontRenderer, txt, x, y, ColorUtil.getARGB(Color.white));
@Override public void drawGuiContainerBackgroundLayer(float f, int mx, int my) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); bindGuiTexture(); int sx = (width - xSize) / 2; int sy = (height - ySize) / 2; drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize); int sw = getFontRenderer().getStringWidth(title); getFontRenderer().drawString(title, width / 2 - sw / 2, sy + 12, ColorUtil.getRGB(Color.red)); ContainerTravelAuth poo = (ContainerTravelAuth) inventorySlots; if (poo.dirty) { poo.dirty = false; failed = false; } if (failed) { drawRect(sx + 43, sy + 27, sx + 43 + 90, sy + 27 + 18, ColorUtil.getARGB(new Color(1f, 0f, 0f, 0.5f))); } super.drawGuiContainerBackgroundLayer(f, mx, my); }