package speiger.src.coreengine.rendering.guiOld.components.icon;

import speiger.src.coreengine.rendering.guiOld.helper.UIShapes;
import speiger.src.coreengine.rendering.guiOld.renderer.UIRenderer;

public class CrossIcon implements IIcon
{
	int color;
	float paddingX = 4F;
	float paddingY = 2F;
	
	public CrossIcon(int color)
	{
		this.color = color;
	}
	
	public CrossIcon setPadding(float x, float y)
	{
		paddingX = x;
		paddingY = y;
		return this;
	}
	
	@Override
	public void render(UIRenderer render, float minX, float minY, float maxX, float maxY, float scale)
	{
		render.push().translate(minX + ((maxX - minX) / 2F), minY + ((maxY - minY) / 2F));
		UIShapes.createCross(render, maxX - minX, maxY - minY, paddingX * scale, paddingY * scale, color);
		render.pop();
	}
	
}
