@Override public void draw(final int x, final int y) { super.draw(x, y); if (maxValue > 0) { int w = 0; if (horizontal) { w = (int) ((bounds.width) * (float) (value) / (maxValue)); RenderHelper.drawHorizontalGradientRect( x + bounds.x, y + bounds.y, x + bounds.x + w, y + bounds.y + bounds.height - 1, 0xFFFF0000, 0xFF550000); } else { w = (int) ((bounds.height) * (float) (value) / (maxValue)); RenderHelper.drawVerticalGradientRect( x + bounds.x, y + bounds.y, x + bounds.x + bounds.width - 1, y + bounds.y + w, 0xFFFF0000, 0xFF550000); } } String s = value + "/" + maxValue; mc.fontRenderer.drawString( mc.fontRenderer.trimStringToWidth(s, getBounds().width), x + bounds.x, y + bounds.y + (bounds.height - mc.fontRenderer.FONT_HEIGHT) / 2, color); }
@Override public void draw(Window window, int x, int y) { if (!visible) { return; } super.draw(window, x, y); if (icon != null) { RenderHelper.renderObject(mc, x + bounds.x, y + bounds.y, icon, false); } }
@Override public void setBounds(Rectangle bounds) { markDirty(); super.setBounds(bounds); }