McJty Posted August 13, 2014 Posted August 13, 2014 I'm trying to draw my GUI: I have the following code: @Override public void drawScreen(int xSize_lo, int ySize_lo, float par3) { super.drawScreen(xSize_lo, ySize_lo, par3); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(iconLocation); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); this.drawVerticalLine(k + 15, l, l + 100, 0x334455); int y = 0; HashMap<Coordinate,BlockInfo> connectedBlocks = monitorItem.getConnectedBlocks(); for (Map.Entry<Coordinate,BlockInfo> me : connectedBlocks.entrySet()) { Block block = me.getValue().getBlock(); Coordinate coordinate = me.getKey(); ItemStack s = new ItemStack(block, 1, 0); // String lname = block.getLocalizedName(); // System.out.println("I18n = " + I18n.format(lname)); // System.out.println("Stat = " + StatCollector.translateToLocal(lname)); mc.fontRenderer.drawString(s.getDisplayName(), k + 5, l + 5 + y, 1677215); mc.fontRenderer.drawString(coordinate.toString(), k+160, l+5+y, 1677215); y += mc.fontRenderer.FONT_HEIGHT + 2; } this.drawGradientRect(k + xSize-20, l + 5, k + xSize-5, l + ySize - 5, 0xFF0000, 0x00FF00); this.drawGradientRect(k + 5, l + 5, k + 10, l + ySize - 5, 0xFF0000, 0x00FF00); mc.fontRenderer.drawString("###", k + 15, l, 0x334455); this.drawVerticalLine(k+15, l, l + 50, 0x334455); } I can see the background texture. I can see all the text that has been rendered. But I cannot see the gradient rects and I cannot see the vertical lines. The coordinates should be right as I'm also using them for the text. Any idea what I'm missing and why only text is visible? Thanks! Quote
McJty Posted August 13, 2014 Author Posted August 13, 2014 Solved! Apparently text ignores alpha but the other calls don't. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.