Table of Contents

Method TryGetLayer

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

TryGetLayer(int, out TilemapLayer?)

Get the TilemapLayer element at the specified index in this Tilemap.

public bool TryGetLayer(int index, out TilemapLayer? layer)

Parameters

index int

The index of the TilemapLayer element to locate.

layer TilemapLayer

When this method returns true, contains the TilemapLayer element located; otherwise, null.

Returns

bool

true if a TilemapLayer element was located at the specified index in this Tilemap; otherwise, false. This method return false when the specified index is less than zero or is greater than or equal to the total number of TilemapLayer elements in this Tilemap.

TryGetLayer(string, out TilemapLayer?)

Gets the TilemapLayer element with the specified name in this Tilemap.

public bool TryGetLayer(string name, out TilemapLayer? layer)

Parameters

name string

The name of the TilemapLayer element to locate.

layer TilemapLayer

When this method returns true, contains the TilemapLayer element located; otherwise, null.

Returns

bool

true if a TilemapLayer element was located in this Tilemap with the specified name; otherwise false. This method returns false if this Tilemap does not contain a TilemapLayer element with the specified name.