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

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

public class ArrowIcon implements IIcon
{
	int color;
	Facing direction;
	float scale = 1F;
	
	public ArrowIcon(int color, Facing direction)
	{
		this.color = color;
		this.direction = direction;
	}
	
	public ArrowIcon setDirection(Facing direction)
	{
		this.direction = direction;
		return this;
	}
	
	public ArrowIcon setScale(float scale)
	{
		this.scale = scale;
		return this;
	}
	
	@Override
	public void render(UIRenderer render, float minX, float minY, float maxX, float maxY, float scale)
	{
		render.push().translate(minX + ((maxX - minX) * 0.5F), minY + ((maxY - minY) * 0.5F));
		UIShapes.createArrow(render, (maxX - minX) * this.scale, (maxY - minY) * this.scale, color, direction);
		render.pop();
	}
	
}
