AIA.Selection.DrawHorizontalLine C# (CSharp) Method

DrawHorizontalLine() public method

public DrawHorizontalLine ( int yPosition, SpriteBatch p_SpriteBatch, Microsoft.Xna.Framework.Graphics.Texture2D _Texture ) : void
yPosition int
p_SpriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
_Texture Microsoft.Xna.Framework.Graphics.Texture2D
return void
        public void DrawHorizontalLine(int yPosition, SpriteBatch p_SpriteBatch, Texture2D _Texture)
        {
            //Selecting an area to the right of the starting point
            if (_SelectionBox.Width > 0)
            {
                //Draw the line moving to the right
                for (int counter = 0; counter <= _SelectionBox.Width - 10; counter += 10)
                {
                    if (_SelectionBox.Width - counter >= 0)
                    {
                        p_SpriteBatch.Draw(_Texture, new Rectangle(_SelectionBox.X + counter, yPosition, 10, 5), Color.White);
                    }
                }
            }
            //When the width is less than 0, the user is selecting an area to the left of the starting point
            else if (_SelectionBox.Width < 0)
            {
                //Draw the line moving to the left
                for (int counter = -10; counter >= _SelectionBox.Width; counter -= 10)
                {
                    if (_SelectionBox.Width - counter <= 0)
                    {
                        p_SpriteBatch.Draw(_Texture, new Rectangle(_SelectionBox.X + counter, yPosition, 10, 5), Color.White);
                    }
                }
            }
        }