Emitter QML Type
发射逻辑粒子。更多
Import Statement: | import QtQuick.Particles |
Inherited By: |
属性
- acceleration : StochasticDirection
- emitRate : real
- enabled : bool
- endSize : real
- group : string
- lifeSpan : int
- lifeSpanVariation : int
- maximumEmitted : int
- shape : Shape
- size : real
- sizeVariation : real
- startTime : int
- system : ParticleSystem
- velocity : StochasticDirection
- velocityFromMovement : real
信号
- emitParticles(Array particles)
方法
详细说明
该元素以给定的起始属性向ParticleSystem 发射逻辑粒子。
请注意,逻辑粒子不会自动渲染,您需要一个或多个ParticlePainter 元素将其可视化。
请注意,给定的起始属性可在粒子生命周期的任何时刻由同一ParticleSystem 中的任何 Affector 元素修改。这包括生命周期等属性。
属性文档
acceleration : StochasticDirection |
粒子发射的起始加速度。
emitRate : real |
每秒发射的粒子数量。
默认值为每秒 10 个粒子。
enabled : bool |
如果设置为 false,发射器将停止发射,直到设置为 true。
默认值为 true。
endSize : real |
粒子寿命结束时的尺寸(像素)。在粒子的生命周期内,尺寸将根据此值和尺寸进行线性插值。如果 endSize 为-1,那么粒子的大小将保持在起始大小不变。
默认值为-1。
group : string |
这是它将发射到的逻辑粒子群。
默认值为""(空字符串)。
lifeSpan : int |
每个发射的粒子应持续的时间(以毫秒为单位)。
如果您不希望粒子在一段时间后自动死亡,例如您希望手动处理它们,请将 lifeSpan 设置为 Emitter.InfiniteLife。
大于或等于 600000(10 分钟)的寿命将被视为无限寿命。寿命小于或等于 0 的粒子一开始就会死亡。
默认值为 1000(一秒)。
lifeSpanVariation : int |
粒子的生命值在任一方向上的变化都不会超过这个数值。
默认值为 0。
maximumEmitted : int |
该发射器每次存活粒子的最大数量。
可以将此设置为性能优化(使用突发和脉冲时)或错开发射。
如果设置为 0 以下,则该发射器的存活粒子数没有最大限制。
默认值为-1。
shape : Shape |
该形状与发射器的大小一起应用。粒子将从形状覆盖的任何区域随机发射。
默认形状是一个填充矩形,相当于发射器的整个边界框。
size : real |
粒子开始时的大小(像素)。
默认值为 16。
startTime : int |
如果在加载发射器时设置了该值,那么它将发射过去的粒子,最长时间为 startTime 毫秒之前。这些粒子将模拟为当时发射的粒子,但不会应用任何影响因子。影响因子将从现在开始生效。
system : ParticleSystem |
这是发射器将发射到的粒子系统。如果发射器是粒子系统的直接子系统,则可以省略此项。ParticleSystem
velocity : StochasticDirection |
发射粒子的起始速度。
velocityFromMovement : real |
如果该值不为零,那么发射器的任何移动都会根据移动情况为粒子提供额外的起始速度。附加矢量的角度与发射器运动的角度相同,大小为发射器运动的大小乘以 velocityFromMovement。
默认值为 0。
信号文档
emitParticles(Array particles) |
particles 是一个由粒子对象组成的 JavaScript 数组。您可以直接在处理程序中修改粒子属性。
注意: JavaScript 的执行速度较慢,因此不建议在大容量粒子系统中使用。
注: 相应的处理程序是onEmitParticles
。
方法文档
burst(int count) |
立即从该发射器发射一定数量的粒子,具体数量由count 指定。
pulse(int duration) |
如果发射器未启用,则会在指定的duration (毫秒)内启用发射器,然后将其关闭。
© 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.