Microsoft.Xna.Framework.Graphics.ESImage.GetTextureCoordinates C# (CSharp) Метод

GetTextureCoordinates() публичный Метод

public GetTextureCoordinates ( Rectangle textureRect ) : System.Vector2[]
textureRect System.Drawing.Rectangle
Результат System.Vector2[]
        public Vector2[] GetTextureCoordinates(Rectangle textureRect)
        {
            Vector2[] coordinates = new Vector2[4];

            coordinates[0] = new Vector2(texWidthRatio * textureRect.Width + (texWidthRatio * textureRect.Left),texHeightRatio * textureRect.Top);
            coordinates[1] = new Vector2(texWidthRatio * textureRect.Width + (texWidthRatio * textureRect.Left),texHeightRatio * textureRect.Height + (texHeightRatio * textureRect.Top));
            coordinates[2] = new Vector2(texWidthRatio * textureRect.Left ,texHeightRatio * textureRect.Top);
            coordinates[3] = new Vector2(texWidthRatio * textureRect.Left,texHeightRatio * textureRect.Height + (texHeightRatio * textureRect.Top));

            return coordinates;
        }