Interface ITextureAtlas
A texture divided into items. Each item is a SubTexture, got by its index.
public interface ITextureAtlas : ITexture
- Inherited Members
Properties
this[object]
The item at index. Its type depends on the atlas: an int for an indexed atlas, a string name for a region atlas. An index of the wrong type throws ArgumentException. Indexes are not range-checked; see TotalItemCount.
SubTexture this[object index] { get; }
Parameters
indexobject
Property Value
Exceptions
- ArgumentException
The index is not of the type this atlas takes.
TotalItemCount
How many items this atlas can be indexed with, across every texture backing it.
int TotalItemCount { get; }
Property Value
Remarks
The indexer deliberately doesn't bounds-check -- it indexes straight into the underlying list -- so a caller working from data it doesn't control (a map naming a tile, a catalog naming a sprite) needs this to tell a legal index from one that would throw. Without it, callers were reduced to inferring the count from Width and assuming a square sheet.