MonoGame_TextureExtensions Class
Definition
Section titled “Definition”Extensions for the Microsoft.Xna.Framework.Graphics.Texture2D type.
public static class MonoGame_TextureExtensionsInheritance object
Methods
Section titled “Methods”ToSurface(Texture2D, IFont, Point, bool)
Section titled “ToSurface(Texture2D, IFont, Point, bool)”Converts a texture’s pixels to a ICellSurface.
public static ICellSurface ToSurface(this Texture2D image, IFont font, Point fontSize, bool blockMode = false)Parameters
Section titled “Parameters”image Microsoft.Xna.Framework.Graphics.Texture2D
The texture to process.
font IFont
The font used with the cell surface.
fontSize SadRogue.Primitives.Point
The size of the font.
blockMode bool
true to indicate the result should use block characters instead of text characters.
Returns
Section titled “Returns”ToSurface(Texture2D, ICellSurface, Color[], IFont, Point, bool)
Section titled “ToSurface(Texture2D, ICellSurface, Color[], IFont, Point, bool)”Converts a texture’s pixels to the specified ICellSurface.
public static void ToSurface(this Texture2D image, ICellSurface surface, Color[] cachedColorArray, IFont font, Point fontSize, bool blockMode = false)Parameters
Section titled “Parameters”image Microsoft.Xna.Framework.Graphics.Texture2D
The texture to process.
surface ICellSurface
The surface to draw on.
cachedColorArray Microsoft.Xna.Framework.Color[]
A buffer holding the color information from the texture.
font IFont
The font used with the cell surface.
fontSize SadRogue.Primitives.Point
The size of the font.
blockMode bool
true to indicate the result should use block characters instead of text characters.
Save(Texture2D, string)
Section titled “Save(Texture2D, string)”Saves a texture to a png file.
public static void Save(this Texture2D target, string path)Parameters
Section titled “Parameters”target Microsoft.Xna.Framework.Graphics.Texture2D
The texture.
path string
The path to a png file.