Table of Contents

Method Draw

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

Draw(SpriteBatch, TextureRegion, Rectangle, Color)

Draws a TextureRegion using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, TextureRegion region, Rectangle destinationRectangle, Color color)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering.

region TextureRegion

The TextureRegion to render.

destinationRectangle Rectangle

A rectangular bound that defines the destination to render the TextureRegion into.

color Color

The color mask to apply when rendering the TextureRegion.

Draw(SpriteBatch, TextureRegion, Vector2, Color)

Draws a TextureRegion using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, TextureRegion region, Vector2 position, Color color)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering.

region TextureRegion

The TextureRegion to render.

position Vector2

The x- and y-coordinate location to render the TextureRegion at.

color Color

The color mask to apply when rendering the TextureRegion.

Draw(SpriteBatch, TextureRegion, Vector2, Color, float, Vector2, float, SpriteEffects, float)

Draws a TextureRegion using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, TextureRegion region, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering.

region TextureRegion

The TextureRegion to render.

position Vector2

The x- and y-coordinate location to render the TextureRegion at.

color Color

The color mask to apply when rendering the TextureRegion.

rotation float

The amount of rotation, in radians, to apply when rendering the TextureRegion.

origin Vector2

The x- and y-coordinate point of origin to apply when rendering the TextureRegion.

scale float

The amount of scaling to apply when rendering the TextureRegion.

effects SpriteEffects

The Microsoft.Xna.Framework.Graphics.SpriteEffects to apply for horizontal and vertical axis flipping when rendering the TextureRegion.

layerDepth float

The layer depth to apply when rendering the TextureRegion.

Draw(SpriteBatch, TextureRegion, Vector2, Color, float, Vector2, Vector2, SpriteEffects, float)

Draws a TextureRegion using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, TextureRegion region, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering.

region TextureRegion

The TextureRegion to render.

position Vector2

The x- and y-coordinate location to render the TextureRegion at.

color Color

The color mask to apply when rendering the TextureRegion.

rotation float

The amount of rotation, in radians, to apply when rendering the TextureRegion.

origin Vector2

The x- and y-coordinate point of origin to apply when rendering the TextureRegion.

scale Vector2

The amount of scaling to apply when rendering the TextureRegion.

effects SpriteEffects

The Microsoft.Xna.Framework.Graphics.SpriteEffects to apply for horizontal and vertical axis flipping when rendering the TextureRegion.

layerDepth float

The layer depth to apply when rendering the TextureRegion.

Draw(SpriteBatch, TextureRegion, Rectangle, Color, float, Vector2, SpriteEffects, float)

Draws a TextureRegion using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, TextureRegion region, Rectangle destinationRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering.

region TextureRegion

The TextureRegion to render.

destinationRectangle Rectangle

A rectangular bound that defines the destination to render the TextureRegion into.

color Color

The color mask to apply when rendering the TextureRegion.

rotation float

The amount of rotation, in radians, to apply when rendering the TextureRegion.

origin Vector2

The x- and y-coordinate point of origin to apply when rendering the TextureRegion.

effects SpriteEffects

The Microsoft.Xna.Framework.Graphics.SpriteEffects to apply for horizontal and vertical axis flipping when rendering the TextureRegion.

layerDepth float

The layer depth to apply when rendering the TextureRegion.

Draw(SpriteBatch, Sprite, Vector2)

Draws a Sprite using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, Sprite sprite, Vector2 position)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering the Sprite.

sprite Sprite

The Sprite to render.

position Vector2

The x- and y-coordinate location to render the Sprite at.

Draw(SpriteBatch, AnimatedTilemap, Vector2, Color)

Draws an AnimatedTilemap using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, AnimatedTilemap animatedTilemap, Vector2 position, Color color)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering the AnimatedTilemap.

animatedTilemap AnimatedTilemap

The AnimatedTilemap to draw.

position Vector2

The x- and y-coordinate location to render the AnimatedTilemap at.

color Color

The color mask to apply when rendering the AnimatedTilemap.

Draw(SpriteBatch, AnimatedTilemap, Vector2, Color, float, float)

Draws an AnimatedTilemap using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, AnimatedTilemap animatedTilemap, Vector2 position, Color color, float scale, float layerDepth)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering the AnimatedTilemap.

animatedTilemap AnimatedTilemap

The AnimatedTilemap to draw.

position Vector2

The x- and y-coordinate location to render the AnimatedTilemap at.

color Color

The color mask to apply when rendering the AnimatedTilemap.

scale float

The amount of scaling to apply when rendering the AnimatedTilemap.

layerDepth float

The layer depth to apply when rendering the AnimatedTilemap.

Draw(SpriteBatch, AnimatedTilemap, Vector2, Color, Vector2, float)

Draws an AnimatedTilemap using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, AnimatedTilemap animatedTilemap, Vector2 position, Color color, Vector2 scale, float layerDepth)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering the AnimatedTilemap.

animatedTilemap AnimatedTilemap

The AnimatedTilemap to draw.

position Vector2

The x- and y-coordinate location to render the AnimatedTilemap at.

color Color

The color mask to apply when rendering the AnimatedTilemap.

scale Vector2

The amount of scaling to apply when rendering the AnimatedTilemap.

layerDepth float

The layer depth to apply when rendering the AnimatedTilemap.

Draw(SpriteBatch, Tilemap, Vector2, Color)

Draws a Tilemap using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, Tilemap tilemap, Vector2 position, Color color)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering the Tilemap.

tilemap Tilemap

The Tilemap to draw.

position Vector2

The x- and y-coordinate location to render the Tilemap at.

color Color

The color mask to apply when rendering the Tilemap.

Draw(SpriteBatch, Tilemap, Vector2, Color, float, float)

Draws a Tilemap using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, Tilemap tilemap, Vector2 position, Color color, float scale, float layerDepth)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering the Tilemap.

tilemap Tilemap

The Tilemap to draw.

position Vector2

The x- and y-coordinate location to render the Tilemap at.

color Color

The color mask to apply when rendering the Tilemap.

scale float

The amount of scaling to apply when rendering the Tilemap.

layerDepth float

The layer depth to apply when rendering the Tilemap.

Draw(SpriteBatch, Tilemap, Vector2, Color, Vector2, float)

Draws a Tilemap using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, Tilemap tilemap, Vector2 position, Color color, Vector2 scale, float layerDepth)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering the Tilemap.

tilemap Tilemap

The Tilemap to draw.

position Vector2

The x- and y-coordinate location to render the Tilemap at.

color Color

The color mask to apply when rendering the Tilemap.

scale Vector2

The amount of scaling to apply when rendering the Tilemap.

layerDepth float

The layer depth to apply when rendering the Tilemap.

Draw(SpriteBatch, TilemapLayer, Vector2, Color)

Draws a TilemapLayer layer using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, TilemapLayer layer, Vector2 position, Color color)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering the TilemapLayer.

layer TilemapLayer

The TilemapLayer to draw.

position Vector2

The x- and y-coordinate location to draw the TilemapLayer at. Drawing the TilemapLayer using this method ignores the Offset.

color Color

The color mask to apply when rendering the TilemapLayer.

Draw(SpriteBatch, TilemapLayer, Vector2, Color, float, float)

Draws a TilemapLayer layer using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, TilemapLayer layer, Vector2 position, Color color, float scale, float layerDepth)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering the TilemapLayer.

layer TilemapLayer

The TilemapLayer to draw.

position Vector2

The x- and y-coordinate location to draw the TilemapLayer at. Drawing the TilemapLayer using this method ignores the Offset.

color Color

The color mask to apply when rendering the TilemapLayer.

scale float

The amount of scaling to apply when rendering the TilemapLayer.

layerDepth float

The layer depth to apply when rendering the TilemapLayer.

Draw(SpriteBatch, TilemapLayer, Vector2, Color, Vector2, float)

Draws a TilemapLayer layer using the Microsoft.Xna.Framework.Graphics.SpriteBatch.

public static void Draw(this SpriteBatch spriteBatch, TilemapLayer layer, Vector2 position, Color color, Vector2 scale, float layerDepth)

Parameters

spriteBatch SpriteBatch

The Microsoft.Xna.Framework.Graphics.SpriteBatch to use for rendering the TilemapLayer.

layer TilemapLayer

The TilemapLayer to draw.

position Vector2

The x- and y-coordinate location to draw the TilemapLayer at. Drawing the TilemapLayer using this method ignores the Offset.

color Color

The color mask to apply when rendering the TilemapLayer.

scale Vector2

The amount of scaling to apply when rendering the TilemapLayer.

layerDepth float

The layer depth to apply when rendering the TilemapLayer.