Example #1
0
        public void CreateRectangle(Rectangle myRectangle)
        {
            Vector2 TopLeft = new Vector2(myRectangle.Left, myRectangle.Top);
            Vector2 TopRight = new Vector2(myRectangle.Right, myRectangle.Top);
            Vector2 BottomLeft = new Vector2(myRectangle.Left, myRectangle.Bottom);
            Vector2 BottomRight = new Vector2(myRectangle.Right, myRectangle.Bottom);

            PrimitiveLine Topbrush = new PrimitiveLine(graphicsDevice,spriteBatch, Colour);
            Topbrush.AddVector(TopLeft);
            Topbrush.AddVector(TopRight);

            PrimitiveLine Bottombrush = new PrimitiveLine(graphicsDevice, spriteBatch, Colour);
            Bottombrush.AddVector(BottomLeft);
            Bottombrush.AddVector(BottomRight);

            PrimitiveLine Leftbrush = new PrimitiveLine(graphicsDevice, spriteBatch, Colour);
            Leftbrush.AddVector(TopLeft);
            Leftbrush.AddVector(BottomLeft);

            PrimitiveLine Rightbrush = new PrimitiveLine(graphicsDevice, spriteBatch, Colour);
            Rightbrush.AddVector(BottomRight);
            Rightbrush.AddVector(TopRight);

            Topbrush.Render(spriteBatch);
            Bottombrush.Render(spriteBatch);
            Leftbrush.Render(spriteBatch);
            Rightbrush.Render(spriteBatch);
        }