Table of Contents

Class TilemapLayer

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

Defines a grid-like layer in a tilemap that contains a collection of tiles.

public sealed class TilemapLayer : IEnumerable<Tile>, IEnumerable
Inheritance
TilemapLayer
Implements
Inherited Members

Constructors

TilemapLayer(string, Tileset, int, int, Vector2)

Initializes a new instance of the TilemapLayer class.

Properties

Columns

Gets the total number of columns in this TilemapLayer.

Height

Gets the height, in pixels, of this TilemapLayer.

Height = Tileset.TileHeight * Rows
IsVisible

Gets or Sets a value that indicates whether this TilemapLayer is visible and should be rendered.

this[Point]

Gets the Tile element located at the specified column and row location in this TilemapLayer.

this[int]

Gets the Tile element at the specified index in this TilemapLayer

this[int, int]

Gets the Tile element located at the specified column and row in this TilemapLayer.

Name

Gets the name assigned to this TilemapLayer.

Offset

Gets or Sets the x- and y-coordinate position offset, relative to the position of the Tilemap, to render this TilemapLayer at

OffsetX

Gets or Sets the x-position offset, relative to the position of the Tilemap, to render this TilemapLayer at

OffsetY

Gets or Sets the y-position offset, relative to the position of the Tilemap, to render this TilemapLayer at

Rows

Gets the total number of rows in this TilemapLayer.

TileCount

Gets the total number of Tile elements in this TilemapLayer.

Tiles

Gets a read-only span of the Tile elements in this TilemapLayer.

Tileset

Gets or Sets the source Tileset referenced by the Tile elements in this TilemapLayer.

Transparency

Gets or Sets the transparency of this TilemapLayer.

Width

Gets the width, in pixels, of this TilemapLayer.

Width = Tileset.TileWidth * Columns

Methods

Clear()

Clears all Tile elements in this TilemapLayer by resetting them to an empty value.

Draw(SpriteBatch, Vector2, Color)

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

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

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

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

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

GetEnumerator()

Returns an enumerator that iterates through the collection.

GetTile(Point)

Gets the Tile element located at the specified column and row location in this TilemapLayer.

GetTile(int)

Gets the Tile element located at the specified index in this TilemapLayer.

GetTile(int, int)

Gets the Tile element located at the specified column and row in this TilemapLayer.

IsEmpty(Point)

Returns a value that indicates whether the Tile element at the specified column and row location in this TilemapLayer is empty.

IsEmpty(int)

Returns a value that indicates whether the Tile element at the specified index in this TilemapLayer is empty.

IsEmpty(int, int)

Returns a value that indicates whether the Tile element at the specified column and row in this TilemapLayer is empty.

SetTile(Point, Tile)

Sets the specified column and row location in this TilemapLayer to the Tile element given.

SetTile(Point, int, bool, bool, bool)

Sets the Tile element at the specified column and row location in this TilemapLayer using the values provided.

SetTile(int, Tile)

Sets the specified index in this TilemapLayer to the Tile element given.

SetTile(int, int, Tile)

Sets the specified column and row in this TilemapLayer to the Tile element given.

SetTile(int, int, bool, bool, bool)

Sets the Tile element at the specified index in this TilemapLayer using the values provided.

SetTile(int, int, int, bool, bool, bool)

Sets the Tile element at the specified column and row in this TilemapLayer using the values provided.