Table of Contents

Class TextureRegion

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

Defines a named rectangular region that represents the location and extents of a region within a source texture.

public class TextureRegion
Inheritance
TextureRegion
Inherited Members

Constructors

TextureRegion(string, Texture2D, Rectangle)

Initializes a new instance of the TextureRegion class.

Properties

Bounds

Gets the rectangular bounds that define the location and width and height extents, in pixels, of the region within the source texture that is represented by this TextureRegion.

Name

Gets the name assigned to this TextureRegion.

Texture

Gets the source texture used by this TextureRegion.

Methods

CreateNinePatchSlice(string, Rectangle, Rectangle, Vector2, Color)

Creates and adds a new NinePatchSlice element to this TextureRegion.

CreateSlice(string, Rectangle, Vector2, Color)

Creates and adds a new Slice element to this TextureRegion.

Draw(SpriteBatch, Rectangle, Color)

Draws this TextureRegion instance using the Microsoft.Xna.Framework.Graphics.SpriteBatch provided.

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

Draws this TextureRegion instance using the Microsoft.Xna.Framework.Graphics.SpriteBatch provided.

Draw(SpriteBatch, Vector2, Color)

Draws this TextureRegion instance using the Microsoft.Xna.Framework.Graphics.SpriteBatch provided.

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

Draws this TextureRegion instance using the Microsoft.Xna.Framework.Graphics.SpriteBatch provided.

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

Draws this TextureRegion instance using the Microsoft.Xna.Framework.Graphics.SpriteBatch provided.

GetSlice(string)

Returns the Slice element with the specified name from this TextureRegion.

GetSlice<T>(string)

Returns the Slice element with the specified name from this TextureRegion as the type specified.

RemoveAllSlices()

Removes all Slice elements from this TextureRegion.

RemoveSlice(string)

Removes the Slice element with the specified name from this TextureRegion.

TryGetSlice(string, out Slice?)

Returns the Slice element with the specified name from this TextureRegion.

TryGetSlice<T>(string, out T?)

Returns the Slice element with the specified name from this TextureRegion as the type specified.