- Qt 6.9
- Qt Quick 3D
- QML Types
- QtQuick3D.Particles3D
- SpriteSequence3D
- Qt Quick 3D | Commercial or GPLv3

# SpriteSequence3D QML Type

Provides image sequence features for the Sprite particles. More...

Import Statement: | `import QtQuick3D.Particles3D`
Since: | Qt 6.2

- List of all members, including inherited members

## Properties

- AnimationDirection : enumeration
- animationDirection : AnimationDirection
- duration : int
- durationVariation : int
- frameCount : int
- frameIndex : int
- interpolate : bool
- randomStart : bool

## Detailed Description

The SpriteSequence3D element provides support for animated images with multiple frames. The frames should be aligned horizontally in the image, first frame being on the left and last on the right.

To make a SpriteParticle3D an animated sequence, set its spriteSequence property.

## Property Documentation

AnimationDirection : enumeration

Defines the animation playback direction of the sequence.

Constant | Description
--- | ---
`SpriteSequence3D.Normal` | Animate from the first frame to the last frame. When the last frame is reached, jump back to the first frame.
`SpriteSequence3D.Reverse` | Animate from the last frame to the first frame. When the first frame is reached, jump back to the last frame.
`SpriteSequence3D.Alternate` | Animate from the first frame to the last frame. When the last or first frame is reached, switch the animation direction. This makes the sequence animation smooth even when the first and the last frames don't match.
`SpriteSequence3D.AlternateReverse` | Animate from the last frame to the first frame. When the last or first frame is reached, switch the animation direction. This makes the sequence animation smooth even when the first and the last frames don't match.
`SpriteSequence3D.SingleFrame` | Don't animate the frame. When the randomStart is false, frameIndex frame is rendered. When the randomStart is true, each particle renders a random frame.

animationDirection : AnimationDirection

This property defines the animation direction of the sequence.

The default value is `SpriteSequence3D.Normal`.

See also randomStart.

duration : int

This property defines the duration in milliseconds how long it takes for the sprite sequence to animate. For example, if the duration is `400` and the frameCount is 8, each frame will be shown for 50 milliseconds. When the value is -1, the particle lifeSpan is used as the duration.

The default value is `-1`.

durationVariation : int

This property defines the duration variation in milliseconds. The actual duration of the animation is between `duration` - `durationVariation` and `duration` + `durationVariation`.

The default value is `0` (no variation).

frameCount : int

This property defines the amount of image frames in sprite. Particle animates through these frames during its duration. The frames should be laid out horizontally in the same image file. For example, sprite could be a `512x64` image, with `frameCount` of `8`. This would make each particle frame size `64x64` pixels.

The default value is `1`.

Note: If your image only has a single sprite frame, don't define the spriteSequence property at all.

See also interpolate.

frameIndex : int

This property defines the initial index of the frame. This is the position in between frames where the animation is started. For example when the `frameIndex` is 5 and the animationDirection is `Normal`, the first rendered frame is 5. If the animationDirection is `Reverse`, the first rendered frame is 4.

The value of frameIndex must be between 0 and frameCount - `1`. When the animationDirection is `SingleFrame` and randomStart is `false`, all the particles will render sprites with the `frameIndex`.

The default value is `0`.

See also randomStart and animationDirection.

interpolate : bool

This property defines if the sprites are interpolated (blended) between frames to make the animation appear smoother.

The default value is `true`.

See also frameCount.

randomStart : bool

This property defines if the animation should start from a random frame between `0` and frameCount - `1`. This allows animations to not look like they all just started when the animation begins.

The default value is `false`.

See also animationDirection.