Table of Contents

Class Tileset

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

Defines a Tileset with a source image and named TextureRegion elements that represent the tiles.

public sealed class Tileset
Inheritance
Tileset
Inherited Members

Remarks

A Tileset is similar in function to a RawTextureAtlas in that it uses a single source image and has named TextureRegion for sections within that image. The difference is that a Tileset auto generates the TextureRegion elements into a grid like structure and the accessor for each TextureRegion is by location id or column and row only.

Constructors

Tileset(string, Texture2D, int, int)

Initializes a new instance of the Tileset class.

Properties

ColumnCount

Gets the total number of columns in this Tileset.

this[Point]

Gets the TextureRegion for the tile at the specified column and row location in this Tileset.

this[int]

Gets the TextureRegion of the tile at the specified index in this Tileset.

this[int, int]

Gets the TextureRegion for the tile at the specified column and row in this Tileset.

Name

Gets the name assigned to this Tileset.

RowCount

Gets the total number of rows in this Tileset.

Texture

Gets the source texture image used by this Tileset.

TileCount

Gets the total number of tiles in this Tileset.

TileHeight

Gets the height, in pixels of each tile in this Tileset.

TileWidth

Gets the width, in pixels, of each tile in this Tileset.

Tiles

Gets a read-only span of the TextureRegion elements that represent the tiles in this Tileset.

Methods

GetTile(Point)

Gets the TextureRegion for the tile at the specified column and row in this Tileset.

GetTile(int)

Gets the TextureRegion of the tile at the specified index in this Tileset.

GetTile(int, int)

Gets the TextureRegion for the tile at the specified column and row in this Tileset.

TryGetTile(Point, out TextureRegion?)

Gets the TextureRegion for the tile at the specified column and row in this Tileset.

TryGetTile(int, out TextureRegion?)

Gets the TextureRegion of the tile at the specified index in this Tileset.

TryGetTile(int, int, out TextureRegion?)

Gets the TextureRegion for the tile at the specified column and row in this Tileset.