Show / Hide Table of Contents

Class MonoGame_TextureExtensions

Extensions for the Microsoft.Xna.Framework.Graphics.Texture2D type.

Inheritance
object
MonoGame_TextureExtensions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: SadConsole.Host.MonoGame.dll
Syntax
public static class MonoGame_TextureExtensions

Methods

Save(Texture2D, string)

Saves a texture to a png file.

Declaration
public static void Save(this Texture2D target, string path)
Parameters
Type Name Description
Texture2D target

The texture.

string path

The path to a png file.

ToSurface(Texture2D, ICellSurface, Color[], IFont, Point, bool)

Converts a texture's pixels to the specified ICellSurface.

Declaration
public static void ToSurface(this Texture2D image, ICellSurface surface, Color[] cachedColorArray, IFont font, Point fontSize, bool blockMode = false)
Parameters
Type Name Description
Texture2D image

The texture to process.

ICellSurface surface

The surface to draw on.

Color[] cachedColorArray

A buffer holding the color information from the texture.

IFont font

The font used with the cell surface.

Point fontSize

The size of the font.

bool blockMode

true to indicate the result should use block characters instead of text characters.

ToSurface(Texture2D, IFont, Point, bool)

Converts a texture's pixels to a ICellSurface.

Declaration
public static ICellSurface ToSurface(this Texture2D image, IFont font, Point fontSize, bool blockMode = false)
Parameters
Type Name Description
Texture2D image

The texture to process.

IFont font

The font used with the cell surface.

Point fontSize

The size of the font.

bool blockMode

true to indicate the result should use block characters instead of text characters.

Returns
Type Description
ICellSurface
In this article

Back to top

Back to top Generated by DocFX