Class TextureExtensions
A set of extensions for dealing with Microsoft.Xna.Framework.Graphics.Texture2D
public static class TextureExtensions
- Inheritance
-
TextureExtensions
- Inherited Members
Methods
GetTextureData(Texture2D)
Returns a new instance of TextureExtensions.TextureData which allows easily managing a texture's data with texture coordinates rather than indices. When this is used in a using statement, the texture data is automatically stored back in the texture at the end.
public static TextureExtensions.TextureData GetTextureData(this Texture2D texture)
Parameters
texture
Texture2DThe texture whose data to get
Returns
- TextureExtensions.TextureData
The texture's data
PremultipliedCopy(Texture2D)
Creates and returns a copy of the given texture
with all colors converted to premultiplied alpha, which is the format that MonoGame's content pipeline loads textures in. This method uses Microsoft.Xna.Framework.Color.FromNonPremultiplied(Microsoft.Xna.Framework.Vector4) for all pixels in the texture
.
public static Texture2D PremultipliedCopy(this Texture2D texture)
Parameters
texture
Texture2DThe texture of which to create a premultiplied copy.
Returns
- Texture2D
The premultiplied copy of the
texture
.