private void AddToBatch(GradientFilledRect entity) { var startColor = entity.Color; var finalColor = entity.FinalColor; vertices[0] = new VertexPosition2DColor( ScreenSpace.Current.ToPixelSpaceRounded(entity.Points[0]), startColor); vertices[1] = new VertexPosition2DColor( ScreenSpace.Current.ToPixelSpaceRounded(entity.Points[1]), finalColor); vertices[2] = new VertexPosition2DColor( ScreenSpace.Current.ToPixelSpaceRounded(entity.Points[2]), finalColor); vertices[3] = new VertexPosition2DColor( ScreenSpace.Current.ToPixelSpaceRounded(entity.Points[3]), startColor); draw.Add(material, vertices, Indices); }
private void AddToBatch(GradientFilledRect entity) { var startColor = entity.Color; var finalColor = entity.FinalColor; vertices[0] = new VertexPosition2DColor( ScreenSpace.Current.ToPixelSpaceRounded(entity.Points[0]), startColor); vertices[1] = new VertexPosition2DColor( ScreenSpace.Current.ToPixelSpaceRounded(entity.Points[1]), finalColor); vertices[2] = new VertexPosition2DColor( ScreenSpace.Current.ToPixelSpaceRounded(entity.Points[2]), finalColor); vertices[3] = new VertexPosition2DColor( ScreenSpace.Current.ToPixelSpaceRounded(entity.Points[3]), startColor); draw.Add(material, vertices, Indices); }
private void CreateGradientRectangles(int numberOfRects, float partsWidth) { for (int i = 0; i < numberOfRects; i++) drawPartitions[i] = new GradientFilledRect(CreatePartDrawAreaForIndex(i, partsWidth), colorIntervals.Values[i], colorIntervals.Values[i + 1]) { RenderLayer = RenderLayer }; }