GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
width -= 8;
RenderUtil.drawTexturedModalRectangle((int) (slider.getSliderPosition() * width), 0, 0, 66, 4, 20, 0f);
RenderUtil.drawTexturedModalRectangle((int) (slider.getSliderPosition() * width) + 4, 0, 196, 66, 4, 20, 0f);
Color color = slider.getTextColor();
if (!slider.isEnabled()) {
color = slider.getDisabledColor();
}
int left = 5;
WidgetAnchor align = slider.getAlign();
if (align == WidgetAnchor.TOP_CENTER || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.BOTTOM_CENTER) {
left = (int) ((width / 2) - (font.getTextWidth(slider.getText()) / 2));
} else if (align == WidgetAnchor.TOP_RIGHT || align == WidgetAnchor.CENTER_RIGHT || align == WidgetAnchor.BOTTOM_RIGHT) {
left = (int) (width - font.getTextWidth(slider.getText())) - 5;
}
GL11.glPushMatrix();
float scale = slider.getScale();
GL11.glScalef(scale, scale, scale);
font.drawString(slider.getText(), left, 6, color.toInt());
GL11.glPopMatrix();
}
}