int SequenceCount { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The SequenceCount property of the Texture class provides the number of sequences contained within a texture. This is particularly useful for textures that are used as sprite sheets or contain multiple frames of animation. The sequence data itself is encoded within the texture, and this property allows you to determine how many sequences are present.

Usage

Use the SequenceCount property when you need to know how many sequences are available in a texture. This can be useful for iterating over frames in an animated texture or when processing sprite sheets.

Example

// Example of accessing the SequenceCount property
Texture myTexture = Texture.Load("path/to/texture");
int numberOfSequences = myTexture.SequenceCount;

if (numberOfSequences > 0)
{
    Console.WriteLine($"The texture contains {numberOfSequences} sequences.");
}
else
{
    Console.WriteLine("The texture does not contain any sequences.");
}