Class MonoGameAdapters
Represents extension methods to adapt MonoGame types to library interfaces.
public static class MonoGameAdapters
- Inheritance
-
MonoGameAdapters
- Inherited Members
Methods
Draw(SpriteBatch, Texture2D, in TextureRenderingOptions)
Performs texture drawing with specified rendering options using an instance of the Microsoft.Xna.Framework.Graphics.SpriteBatch class.
public static void Draw(this SpriteBatch spriteBatch, Texture2D texture, in TextureRenderingOptions options)
Parameters
spriteBatchSpriteBatchAn instance of the Microsoft.Xna.Framework.Graphics.SpriteBatch to draw texture with.
textureTexture2DAn instance of the Microsoft.Xna.Framework.Graphics.Texture2D to render.
optionsTextureRenderingOptionsOptions for texture drawing.
Unwrap(ITexture)
Tries to unwrap an instance of the texture that has been wrapped using Wrap(Texture2D).
public static Texture2D Unwrap(this ITexture texture)
Parameters
textureITextureAn instance of the ITexture that has been making by calling Wrap(Texture2D).
Returns
- Texture2D
An instance of the Microsoft.Xna.Framework.Graphics.Texture2D that has been wrapped to create
texture.
Exceptions
- InvalidOperationException
Occurs when
texturewasn't wrapped using Wrap(Texture2D) before.
Wrap(Texture2D)
Wraps an instance of the Microsoft.Xna.Framework.Graphics.Texture2D into ITexture interface for library usage.
public static ITexture Wrap(this Texture2D texture)
Parameters
textureTexture2DAn instance of the Microsoft.Xna.Framework.Graphics.Texture2D to wrap.