Attractor QML Type

将粒子吸引到一个特定的点上。更多

Import Statement: import QtQuick.Particles
Inherits:

ParticleAffector

属性

详细说明

与其他影响器一样,Attractor 也具有代表受影响区域的标准属性 x、y、宽度和高度。Attractor 项的大小和位置决定了受影响的粒子。

吸引点的大小始终为 0x0,其位置由pointXpointY 属性指定。

属性文档

affectedParameter : enumeration

直接受影响的粒子属性。

常数描述
Attractor.Position位置
Attractor.Velocity速度
Attractor.Acceleration加速度

pointX : real

吸引点的 x 坐标,相对于吸引项的 x 坐标。


pointY : real

吸引点的 y 坐标,相对于吸引项的 y 坐标。


proportionalToDistance : enumeration

吸引力strength 与粒子到吸引点的距离之间的关系。

常数说明
Attractor.Constant常量
Attractor.Linear线性
Attractor.InverseLinear反线性
Attractor.Quadratic二次
Attractor.InverseQuadratic反二次方

strength : real

对一个像素点外的物体施加的拉力,单位为每秒。

强度与proportionalToDistance 属性的值一起决定了对远处粒子施加的拉力的确切大小。


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