AStarCollisionMap.DrawUtil.DrawCross C# (CSharp) Метод

DrawCross() публичный статический Метод

Draws a cross.
public static DrawCross ( SpriteBatch batch, Rectangle rect, int width, Color c ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch The SpriteBatch to draw on.
rect Microsoft.Xna.Framework.Rectangle The rectangle to draw on.
width int The width of the border.
c Color The Color
Результат void
        public static void DrawCross(SpriteBatch batch, Rectangle rect, int width, Color c)
        {
            // Top left to bottom left
            DrawLine(batch,
                new Point(rect.Left, rect.Top),
                new Point(rect.Left, rect.Bottom),
                c,
                width);
            // Top left to top right
            DrawLine(batch,
                new Point(rect.Left, rect.Top),
                new Point(rect.Right, rect.Top),
                c,
                width);
            // Top right to bottom right
            DrawLine(batch,
                new Point(rect.Right, rect.Top),
                new Point(rect.Right, rect.Bottom),
                c,
                width);
            // Bottom right to bottom left
            DrawLine(batch,
                new Point(rect.Right, rect.Bottom),
                new Point(rect.Left, rect.Bottom),
                c,
                width);
        }