SimpleJavaEngine/src/main/java/speiger/src/coreengine/rendering/gui/components/icon/LineIcon.java

28 lines
647 B
Java

package speiger.src.coreengine.rendering.gui.components.icon;
import speiger.src.coreengine.rendering.gui.renderer.UIRenderer;
public class LineIcon implements IIcon
{
int color;
float height;
float padding;
float thickness = 1F;
public LineIcon(int color, float height, float padding)
{
this.color = color;
this.height = height;
this.padding = padding;
}
@Override
public void render(UIRenderer render, float minX, float minY, float maxX, float maxY, float scale)
{
float y = minY + ((maxY - minY) * height);
float x = (maxX - minX) * padding;
render.drawQuad(minX + x, y - (0.5F * scale), maxX - x, y, color);
}
}