本页内容

SpriteParticle3D QML Type

使用 2D 精灵贴图的粒子。更多...

Import Statement: import QtQuick3D.Particles3D
Since: Qt 6.2
Inherits:

Particle3D

Inherited By:

LineParticle3D

属性

详细说明

SpriteParticle3D 是一个逻辑粒子元素,用于根据 2D 精灵纹理生成粒子。

属性文档

BlendMode : enumeration

定义粒子的混合模式。

常量说明
SpriteParticle3D.SourceOver使用“SourceOver”模式混合粒子。
SpriteParticle3D.Screen使用“屏幕”模式混合粒子。
SpriteParticle3D.Multiply使用“乘法”模式混合粒子。

billboard : bool

此属性用于定义粒子纹理是否应始终朝向屏幕对齐。

注意:当 设置为true时 ,Particle3D 的alignMode 属性将不起作用。

默认值为false 。

blendMode : BlendMode

此属性定义了用于渲染粒子的混合模式。

默认值为SpriteParticle3D.SourceOver 。

castsReflections : bool [since 6.4]

当此属性设置为“true ”时,该精灵将通过反射探针进行渲染,并可在反射中看到。

该属性于 Qt 6.4 版本中引入。

colorTable : Texture

该属性定义了用于给粒子着色的Texture 。该图像可以是1D或2D纹理。水平像素决定了粒子在其lifeSpan 上的颜色。例如,当粒子处于生命周期的 halfway 时,它将呈现图像 halfway 处指定的颜色。如果图像为2D,则会为每个粒子随机选择垂直行。 例如,一张 c {256 x 4} 的图像包含4 种不同的粒子着色选项。

lights : list<Light> [since 6.3]

该属性包含用于渲染粒子的lights 列表。

注意:为获得 最佳性能,请仅在需要时定义光源,并将光源数量控制在最低限度。

该属性自 Qt 6.3 起引入。

offsetX : real [since 6.3]

该属性定义了粒子在 X 轴上的偏移量

该属性自 Qt 6.3 起引入。

offsetY : real [since 6.3]

该属性定义了粒子在 Y 轴上的偏移量

该属性于 Qt 6.3 中引入。

particleScale : real

此属性定义了粒子的缩放倍数。要调整发射器中粒子的大小,请使用ParticleEmitter3D 、particleScale 、particleEndScale 和particleScaleVariation 属性。

默认值为5.0 。

sprite : Texture

此属性定义了粒子所使用的Texture 。

例如,若要使用“snowFlake.png”作为粒子纹理:

SpriteParticle3D {
    id: snowParticle
    ...
    sprite: Texture {
        source: "images/snowflake.png"
    }
}

spriteSequence : SpriteSequence3D

此属性用于定义粒子的精灵序列属性。如果sprite 纹理包含一帧序列,请设置此属性以定义帧数、动画方向等功能。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.