Class TextureRegionExtensions
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
StaticSpriteBatchtexture
TextureRegionA texture.
destinationRectangle
RectangleFcolor
ColorA 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
StaticSpriteBatchtexture
TextureRegionA texture.
destinationRectangle
RectangleFcolor
ColorA color mask.
rotation
floatA rotation of this sprite.
origin
Vector2Center of the rotation. 0,0 by default.
effects
SpriteEffectsModificators for drawing. Can be combined.
layerDepth
floatA 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
StaticSpriteBatchtexture
TextureRegionA texture.
destinationRectangle
Rectanglecolor
ColorA 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
StaticSpriteBatchtexture
TextureRegionA texture.
destinationRectangle
Rectanglecolor
ColorA color mask.
rotation
floatA rotation of this sprite.
origin
Vector2Center of the rotation. 0,0 by default.
effects
SpriteEffectsModificators for drawing. Can be combined.
layerDepth
floatA 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
StaticSpriteBatchtexture
TextureRegionA texture.
position
Vector2The drawing location on screen.
color
ColorA 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
StaticSpriteBatchtexture
TextureRegionA texture.
position
Vector2The drawing location on screen.
color
ColorA color mask.
rotation
floatA rotation of this sprite.
origin
Vector2Center of the rotation. 0,0 by default.
scale
Vector2A scaling of this sprite.
effects
SpriteEffectsModificators for drawing. Can be combined.
layerDepth
floatA 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
StaticSpriteBatchtexture
TextureRegionA texture.
position
Vector2The drawing location on screen.
color
ColorA color mask.
rotation
floatA rotation of this sprite.
origin
Vector2Center of the rotation. 0,0 by default.
scale
floatA scaling of this sprite.
effects
SpriteEffectsModificators for drawing. Can be combined.
layerDepth
floatA 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
SpriteBatchtexture
TextureRegionA texture.
destinationRectangle
RectangleFcolor
ColorA 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
SpriteBatchtexture
TextureRegionA texture.
destinationRectangle
RectangleFcolor
ColorA color mask.
rotation
floatA rotation of this sprite.
origin
Vector2Center of the rotation. 0,0 by default.
effects
SpriteEffectsModificators for drawing. Can be combined.
layerDepth
floatA 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
SpriteBatchtexture
TextureRegionA texture.
destinationRectangle
Rectanglecolor
ColorA 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
SpriteBatchtexture
TextureRegionA texture.
destinationRectangle
Rectanglecolor
ColorA color mask.
rotation
floatA rotation of this sprite.
origin
Vector2Center of the rotation. 0,0 by default.
effects
SpriteEffectsModificators for drawing. Can be combined.
layerDepth
floatA 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
SpriteBatchtexture
TextureRegionA texture.
position
Vector2The drawing location on screen.
color
ColorA 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
SpriteBatchtexture
TextureRegionA texture.
position
Vector2The drawing location on screen.
color
ColorA color mask.
rotation
floatA rotation of this sprite.
origin
Vector2Center of the rotation. 0,0 by default.
scale
Vector2A scaling of this sprite.
effects
SpriteEffectsModificators for drawing. Can be combined.
layerDepth
floatA 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
SpriteBatchtexture
TextureRegionA texture.
position
Vector2The drawing location on screen.
color
ColorA color mask.
rotation
floatA rotation of this sprite.
origin
Vector2Center of the rotation. 0,0 by default.
scale
floatA scaling of this sprite.
effects
SpriteEffectsModificators for drawing. Can be combined.
layerDepth
floatA depth of the layer of this sprite.