SpriteSequence3D QML Type

Provides image sequence features for the Sprite particles. 更多...

import 语句: import QtQuick3D.Particles3D
Since: Qt 6.2
继承: QtObject

特性

详细描述

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 特性。

特性文档编制

AnimationDirection : enumeration

Defines the animation playback direction of the sequence.

常量 描述
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.

默认值为 SpriteSequence3D.Normal .

另请参阅 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 frameCount is 8, each frame will be shown for 50 milliseconds. When the value is -1, the particle lifeSpan is used as the duration.

默认值为 -1 .


durationVariation : int

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

默认值为 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 像素。

默认值为 1 .

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

另请参阅 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 .

默认值为 0 .

另请参阅 randomStart and animationDirection .


interpolate : bool

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

默认值为 true .

另请参阅 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.

默认值为 false .

另请参阅 animationDirection .