Nez.Portable/Utils/Extensions/SpriteBatchExt.cs
/// <summary>
/// Draws a list of connected points
/// </summary>
/// <param name="points">The points to connect with lines</param>
/// <param name="color">The color to use</param>
/// <param name="thickness">The thickness of the lines</param>
/// <param name="closePoly">If set to <c>true</c> the first and last points will be connected.</param>
Draws a list of connected points
Draws a list of connected points
public static void drawPoints(
            this SpriteBatch spriteBatch,
            Vector2 position,
            Vector2[] points,
            Color color,
            bool closePoly = true,
            float thickness = 1)
        {
            if (points.Length < 2)
                return;
            for (int i = 1; i < points.Length; i++)
                drawLine(spriteBatch, position + points[i - 1], position + points[i], color, thickness);
            if (closePoly)
                drawLine(spriteBatch, position + points[points.Length - 1], position + points[0], color, thickness);
        }
public static void drawPoints ( this SpriteBatch spriteBatch , Vector2 position , Vector2 [ ] points , Color color , bool closePoly = true , float thickness = 1 ) { if ( points . Length < 2 ) return ; for ( int i = 1 ; i < points . Length ; i ++ ) drawLine ( spriteBatch , position + points [ i - 1 ] , position + points [ i ] , color , thickness ) ; if ( closePoly ) drawLine ( spriteBatch , position + points [ points . Length - 1 ] , position + points [ 0 ] , color , thickness ) ; }
Draws a list of connected points
Draws a list of connected points
SpriteBatch
this
position
Vector2
points
Vector2[]
The points to connect with lines
The points to connect with lines
color
Color
The color to use
The color to use
closePoly
bool
If set to true
If set to true
thickness
float
The thickness of the lines
The thickness of the lines