Microsoft.Xna.Framework.PointExtensions.ToIndex C# (CSharp) Method

ToIndex() public static method

Translates an x,y position to an array index.
public static ToIndex ( this point, int rowWidth ) : int
point this The position.
rowWidth int How many columns in a row.
return int
        public static int ToIndex(this Point point, int rowWidth)
        {
            return point.Y * rowWidth + point.X;
        }