public static ScaledTexture2D FromTexture(Texture2D orgTexture, Texture2D scaledTexture, float scale, Rectangle?forcedSourceRectangle = null) { Color[] data = new Color[orgTexture.Width * orgTexture.Height]; orgTexture.GetData(data); ScaledTexture2D result = new ScaledTexture2D(orgTexture.GraphicsDevice, orgTexture.Width, orgTexture.Height, scaledTexture, scale, forcedSourceRectangle); result.SetData(data); return(result); }
public static ScaledTexture2D FromTexture(Texture2D orgTexture, Texture2D scaledTexture, float scale) { Color[] data = new Color[orgTexture.Width * orgTexture.Height]; orgTexture.GetData(data); ScaledTexture2D result = new ScaledTexture2D(orgTexture.GraphicsDevice, orgTexture.Width, orgTexture.Height, scaledTexture, scale); result.STexture = scaledTexture; result.Scale = scale; result.SetData(data); return(result); }