ParticleSystem QML Type

一个包含粒子绘制器、发射器和影响器类型的系统。更多

Import Statement: import QtQuick.Particles

属性

方法

详细说明

属性文档

empty : bool

当系统中没有活粒子时,empty 将被设置为 true。

您可以用它来暂停系统,使其不再花费时间进行更新,但您需要恢复系统,以便系统生成更多粒子。

要杀死系统中的所有粒子,请使用 "年龄 "影响因子。


particleStates : list<Sprite>

您可以在此属性中定义粒子群的子集,以便为它们提供随机状态转换。

该列表中的每个 QtQuick::Sprite 都会被解释为对应于同名的粒子组。这些精灵中定义的任何转换也将对粒子组生效。此外,在这些精灵中定义的 TrailEmitters、Affectors 和 ParticlePainters 会自动与相应的粒子组关联。


paused : bool

如果将 "暂停 "设置为 "true",粒子系统将不会推进模拟。如果再次将 "暂停 "设置为 "假",模拟将从暂停时的相同点继续进行。

如果检测到没有活粒子了,模拟就会自动暂停,而当有新的活粒子加入时,模拟又会自动取消暂停。

还可以使用pause() 和resume() 方法对其进行控制。


running : bool

如果运行设置为 false,粒子系统将停止模拟。当系统再次设置为运行时,所有粒子都将被销毁。

也可以使用start() 和stop() 方法对其进行控制。


方法文档

pause()

暂停正在运行的模拟。

另请参阅 resumepaused


reset()

丢弃当前存在的所有粒子。


restart()

如果模拟正在运行,则停止模拟,然后启动模拟。

另请参阅 start,stop, 和running


resume()

如果模拟暂停,则恢复模拟。

另请参阅 pausepaused


start()

如果模拟尚未运行,则启动模拟。

另请参阅 stop,restart, 和running


stop()

如果模拟正在运行,则停止模拟。

另请参阅 start,restart, 和running


© 2025 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.