Table of Contents

Method TryGetRegion

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

TryGetRegion(int, out TextureRegion?)

Gets the TextureRegion element at the specified index in this TextureAtlas.

public bool TryGetRegion(int index, out TextureRegion? region)

Parameters

index int

The index of the TextureRegion element to locate.

region TextureRegion

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

Returns

bool

true if a TextureRegion element was located; otherwise, false. This method returns false if the index specified is less than zero or is greater than or equal to the total number of TextureRegion elements in this TextureAtlas.

TryGetRegion(string, out TextureRegion?)

Gets the TextureRegion element with the specified name in this TextureAtlas.

public bool TryGetRegion(string name, out TextureRegion? region)

Parameters

name string

The name of the TextureRegion element to locate.

region TextureRegion

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

Returns

bool

true if a TextureRegion element was located; otherwise, false. This method returns false if this TextureAtlas does not contain a TextureRegion element with the specified name.