Microsoft.Xna.Framework.Graphics.ESImage.GetSubImageAtPoint C# (CSharp) Method

GetSubImageAtPoint() public method

public GetSubImageAtPoint ( System.Vector2 point, int subImageWidth, int subImageHeight, float subImageScale ) : ESImage
point System.Vector2
subImageWidth int
subImageHeight int
subImageScale float
return ESImage
        public ESImage GetSubImageAtPoint(Vector2 point, int subImageWidth, int subImageHeight, float subImageScale)
        {
            //Create a new Image instance using the texture which has been assigned to the current instance
            ESImage subImage = new ESImage(texture,subImageScale);
            // Define the offset of the subimage we want using the point provided
            subImage.TextureOffsetX = (int) point.X;
            subImage.TextureOffsetY = (int) point.Y;

            // Set the width and the height of the subimage
            subImage.ImageWidth = subImageWidth;
            subImage.ImageHeight = subImageHeight;

            return subImage;
        }