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 such sequences are present.

Usage

To access the SequenceCount property, you need to have an instance of the Texture class. This property is read-only and returns an integer representing the number of sequences.

Example

// Assuming 'texture' is an instance of Sandbox.Texture
int numberOfSequences = texture.SequenceCount;

// Use the sequence count for logic, e.g., iterating over sequences
for (int i = 0; i < numberOfSequences; i++)
{
    // Process each sequence
}