ParticleSystem QML Type
一个包含粒子绘制器、发射器和影响器类型的系统。更多...
| Import Statement: | import QtQuick.Particles |
属性
- empty : bool
- particleStates : list<Sprite>
- paused : bool
- running : bool
方法
详细说明
物业文件
empty : bool
当系统中不再有活跃粒子时,empty 会被设置为 true。
您可以利用此功能暂停系统,使其不再花费时间进行更新,但若要让系统生成新的粒子,则需要将其恢复运行。
若要清除系统中的所有粒子,请使用“Age”影响器。
particleStates : list<Sprite>
您可以在该属性中定义粒子组的子集,以便为其提供随机状态转换。
列表中的每个 QtQuick::Sprite 都会被解释为对应于同名的粒子组。在这些精灵中定义的任何状态转换也将对相应的粒子组生效。此外,在这些精灵之一中定义的 TrailEmitters、Affectors 和 ParticlePainters 会自动与相应的粒子组关联。
paused : bool
如果将“paused”设置为 true,粒子系统将不会继续模拟。当“paused”再次设置为 false 时,模拟将从暂停时的同一位置继续。
如果检测到已无存活粒子,模拟将自动暂停;当新增存活粒子时,模拟将自动恢复。
此外,还可以通过pause()和resume()方法进行控制。
running : bool
如果“running”属性设置为 false,粒子系统将停止模拟。当系统再次设置为“running”时,所有粒子都将被销毁。
方法文档
void pause()
如果模拟正在运行,则暂停模拟。
void reset()
清除所有当前存在的粒子。
void restart()
如果模拟正在运行,则停止模拟,然后重新启动。
void resume()
如果模拟已暂停,则恢复模拟。
void start()
如果模拟尚未运行,则启动模拟。
另请参阅 stop 、restart 以及running 。
void stop()
如果模拟正在运行,则停止模拟。
© 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.