Table of Contents

Class TextureRegionExtensions

Namespace
MLEM.Textures
Assembly
MLEM.dll

This class provides a set of extension methods for dealing with TextureRegion

public static class TextureRegionExtensions
Inheritance
TextureRegionExtensions
Inherited Members

Methods

Add(StaticSpriteBatch, TextureRegion, RectangleF, Color)

Adds an item to this batch. Note that this batch needs to currently be batching, meaning BeginBatch(SpriteSortMode?) has to have been called previously.

public static StaticSpriteBatch.Item Add(this StaticSpriteBatch batch, TextureRegion texture, RectangleF destinationRectangle, Color color)

Parameters

batch StaticSpriteBatch
texture TextureRegion

A texture.

destinationRectangle RectangleF
color Color

A color mask.

Returns

StaticSpriteBatch.Item

The StaticSpriteBatch.Item that was created from the added data

Add(StaticSpriteBatch, TextureRegion, RectangleF, Color, float, Vector2, SpriteEffects, float)

Adds an item to this batch. Note that this batch needs to currently be batching, meaning BeginBatch(SpriteSortMode?) has to have been called previously.

public static StaticSpriteBatch.Item Add(this StaticSpriteBatch batch, TextureRegion texture, RectangleF destinationRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth)

Parameters

batch StaticSpriteBatch
texture TextureRegion

A texture.

destinationRectangle RectangleF
color Color

A color mask.

rotation float

A rotation of this sprite.

origin Vector2

Center of the rotation. 0,0 by default.

effects SpriteEffects

Modificators for drawing. Can be combined.

layerDepth float

A depth of the layer of this sprite.

Returns

StaticSpriteBatch.Item

The StaticSpriteBatch.Item that was created from the added data

Add(StaticSpriteBatch, TextureRegion, Rectangle, Color)

Adds an item to this batch. Note that this batch needs to currently be batching, meaning BeginBatch(SpriteSortMode?) has to have been called previously.

public static StaticSpriteBatch.Item Add(this StaticSpriteBatch batch, TextureRegion texture, Rectangle destinationRectangle, Color color)

Parameters

batch StaticSpriteBatch
texture TextureRegion

A texture.

destinationRectangle Rectangle
color Color

A color mask.

Returns

StaticSpriteBatch.Item

The StaticSpriteBatch.Item that was created from the added data

Add(StaticSpriteBatch, TextureRegion, Rectangle, Color, float, Vector2, SpriteEffects, float)

Adds an item to this batch. Note that this batch needs to currently be batching, meaning BeginBatch(SpriteSortMode?) has to have been called previously.

public static StaticSpriteBatch.Item Add(this StaticSpriteBatch batch, TextureRegion texture, Rectangle destinationRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth)

Parameters

batch StaticSpriteBatch
texture TextureRegion

A texture.

destinationRectangle Rectangle
color Color

A color mask.

rotation float

A rotation of this sprite.

origin Vector2

Center of the rotation. 0,0 by default.

effects SpriteEffects

Modificators for drawing. Can be combined.

layerDepth float

A depth of the layer of this sprite.

Returns

StaticSpriteBatch.Item

The StaticSpriteBatch.Item that was created from the added data

Add(StaticSpriteBatch, TextureRegion, Vector2, Color)

Adds an item to this batch. Note that this batch needs to currently be batching, meaning BeginBatch(SpriteSortMode?) has to have been called previously.

public static StaticSpriteBatch.Item Add(this StaticSpriteBatch batch, TextureRegion texture, Vector2 position, Color color)

Parameters

batch StaticSpriteBatch
texture TextureRegion

A texture.

position Vector2

The drawing location on screen.

color Color

A color mask.

Returns

StaticSpriteBatch.Item

The StaticSpriteBatch.Item that was created from the added data

Add(StaticSpriteBatch, TextureRegion, Vector2, Color, float, Vector2, Vector2, SpriteEffects, float)

Adds an item to this batch. Note that this batch needs to currently be batching, meaning BeginBatch(SpriteSortMode?) has to have been called previously.

public static StaticSpriteBatch.Item Add(this StaticSpriteBatch batch, TextureRegion texture, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth)

Parameters

batch StaticSpriteBatch
texture TextureRegion

A texture.

position Vector2

The drawing location on screen.

color Color

A color mask.

rotation float

A rotation of this sprite.

origin Vector2

Center of the rotation. 0,0 by default.

scale Vector2

A scaling of this sprite.

effects SpriteEffects

Modificators for drawing. Can be combined.

layerDepth float

A depth of the layer of this sprite.

Returns

StaticSpriteBatch.Item

The StaticSpriteBatch.Item that was created from the added data

Add(StaticSpriteBatch, TextureRegion, Vector2, Color, float, Vector2, float, SpriteEffects, float)

Adds an item to this batch. Note that this batch needs to currently be batching, meaning BeginBatch(SpriteSortMode?) has to have been called previously.

public static StaticSpriteBatch.Item Add(this StaticSpriteBatch batch, TextureRegion texture, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth)

Parameters

batch StaticSpriteBatch
texture TextureRegion

A texture.

position Vector2

The drawing location on screen.

color Color

A color mask.

rotation float

A rotation of this sprite.

origin Vector2

Center of the rotation. 0,0 by default.

scale float

A scaling of this sprite.

effects SpriteEffects

Modificators for drawing. Can be combined.

layerDepth float

A depth of the layer of this sprite.

Returns

StaticSpriteBatch.Item

The StaticSpriteBatch.Item that was created from the added data

Draw(SpriteBatch, TextureRegion, RectangleF, Color)

Submit a sprite for drawing in the current batch.

public static void Draw(this SpriteBatch batch, TextureRegion texture, RectangleF destinationRectangle, Color color)

Parameters

batch SpriteBatch
texture TextureRegion

A texture.

destinationRectangle RectangleF
color Color

A color mask.

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

Submit a sprite for drawing in the current batch.

public static void Draw(this SpriteBatch batch, TextureRegion texture, RectangleF destinationRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth)

Parameters

batch SpriteBatch
texture TextureRegion

A texture.

destinationRectangle RectangleF
color Color

A color mask.

rotation float

A rotation of this sprite.

origin Vector2

Center of the rotation. 0,0 by default.

effects SpriteEffects

Modificators for drawing. Can be combined.

layerDepth float

A depth of the layer of this sprite.

Draw(SpriteBatch, TextureRegion, Rectangle, Color)

Submit a sprite for drawing in the current batch.

public static void Draw(this SpriteBatch batch, TextureRegion texture, Rectangle destinationRectangle, Color color)

Parameters

batch SpriteBatch
texture TextureRegion

A texture.

destinationRectangle Rectangle
color Color

A color mask.

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

Submit a sprite for drawing in the current batch.

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

Parameters

batch SpriteBatch
texture TextureRegion

A texture.

destinationRectangle Rectangle
color Color

A color mask.

rotation float

A rotation of this sprite.

origin Vector2

Center of the rotation. 0,0 by default.

effects SpriteEffects

Modificators for drawing. Can be combined.

layerDepth float

A depth of the layer of this sprite.

Draw(SpriteBatch, TextureRegion, Vector2, Color)

Submit a sprite for drawing in the current batch.

public static void Draw(this SpriteBatch batch, TextureRegion texture, Vector2 position, Color color)

Parameters

batch SpriteBatch
texture TextureRegion

A texture.

position Vector2

The drawing location on screen.

color Color

A color mask.

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

Submit a sprite for drawing in the current batch.

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

Parameters

batch SpriteBatch
texture TextureRegion

A texture.

position Vector2

The drawing location on screen.

color Color

A color mask.

rotation float

A rotation of this sprite.

origin Vector2

Center of the rotation. 0,0 by default.

scale Vector2

A scaling of this sprite.

effects SpriteEffects

Modificators for drawing. Can be combined.

layerDepth float

A depth of the layer of this sprite.

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

Submit a sprite for drawing in the current batch.

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

Parameters

batch SpriteBatch
texture TextureRegion

A texture.

position Vector2

The drawing location on screen.

color Color

A color mask.

rotation float

A rotation of this sprite.

origin Vector2

Center of the rotation. 0,0 by default.

scale float

A scaling of this sprite.

effects SpriteEffects

Modificators for drawing. Can be combined.

layerDepth float

A depth of the layer of this sprite.