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 AnimatedTilemapFrame.

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 AnimatedTilemapFrame; 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 AnimatedTilemapFrame.

TryGetLayer(string, out TilemapLayer?)

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

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 AnimatedTilemapFrame with the specified name; otherwise false. This method returns false if this AnimatedTilemapFrame does not contain a TilemapLayer element with the specified name.