Method TryGetRegion
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
intThe index of the TextureRegion element to locate.
region
TextureRegionWhen 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
stringThe name of the TextureRegion element to locate.
region
TextureRegionWhen 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.