예제 #1
0
        public static UILineVO LineTo(this UICanvas canvas, Vector2 point)
        {
            UILineVO line = canvas.Strokes.Last();

            if (line == null)
            {
                return(canvas.MoveTo(point));
            }
            line.points.Add(point);
            return(line);
        }
예제 #2
0
        public static UILineVO MoveTo(this UICanvas canvas, Vector2 point)
        {
            UILineVO line = new UILineVO();

            line.points.Add(point);
            line.fill      = canvas.strokeStyle.fill;
            line.stroke    = canvas.strokeStyle.stroke;
            line.fillColor = canvas.strokeStyle.fillColor;
            line.color     = canvas.strokeStyle.strokeColor;
            line.thickness = canvas.strokeStyle.thickness;
            canvas.Strokes.Add(line);
            return(line);
        }
예제 #3
0
        private static void FillPolygon(UICanvas canvas, List <UIVertex> vertices, List <int> indices, UILineVO line)
        {
            var points = line.points.GetRange(0, line.points.Count - 1);

            canvas.FillPolygon(vertices, indices, points, line.fillColor, line.name);
        }
예제 #4
0
 public static void DrawLine(this UICanvas canvas, List <UIVertex> vertices, List <int> indices, UILineVO line)
 {
     if (line.fill)
     {
         FillPolygon(canvas, vertices, indices, line);
     }
     if (line.stroke)
     {
         canvas.StrokePolygon(vertices, indices, line.points, line.thickness, line.color);
     }
 }