use of de.canitzp.tumat.api.IComponentRender in project TUMAT by canitzp.
the class RenderOverlay method renderComponents.
public static void renderComponents(FontRenderer fontRenderer, TooltipComponent component) {
if (component != null) {
TooltipComponent.Finished finished = component.close();
int x = GuiTUMAT.getXFromPercantage();
int y = GuiTUMAT.getYFromPercantage() + getBossBarOffset();
int lines = 0;
boolean renderIcon = ConfigBoolean.RENDER_ICONS.value && component.getIconRenderer() != null && component.getIconRenderer().shouldRender();
if (ConfigBoolean.SHOW_BACKGROUND.value) {
renderBackground(x, y, finished.getLength(), finished.getHeight(), renderIcon);
}
GlStateManager.pushMatrix();
for (IComponentRender render : finished.getComponents()) {
if (render != null) {
GlStateManager.scale(ConfigFloat.SCALE.value, ConfigFloat.SCALE.value, ConfigFloat.SCALE.value);
render.render(fontRenderer, x, y, 0xFFFFFF);
int lineY = render.getLines(fontRenderer) * render.getHeightPerLine(fontRenderer);
lines += lineY;
y += lineY;
}
}
if (renderIcon) {
component.getIconRenderer().render(x - finished.getLength() / 2 - 22, GuiTUMAT.getYFromPercantage() + (lines / 2 - 10));
}
GlStateManager.popMatrix();
}
}
Aggregations