152 Q_UNUSED(particle); |
152 Q_UNUSED(particle); |
153 } |
153 } |
154 |
154 |
155 /*! |
155 /*! |
156 \qmlclass ParticleMotionLinear QDeclarativeParticleMotionLinear |
156 \qmlclass ParticleMotionLinear QDeclarativeParticleMotionLinear |
|
157 \ingroup qml-particle-elements |
157 \since 4.7 |
158 \since 4.7 |
158 \brief The ParticleMotionLinear object moves particles linearly. |
159 \brief The ParticleMotionLinear object moves particles linearly. |
159 |
160 |
160 \sa Particles |
161 \sa Particles |
161 |
162 |
162 This is the default motion, and moves the particles according to the |
163 This is the default motion, and moves the particles according to the |
163 properties specified in the Particles element. |
164 properties specified in the Particles element. |
164 |
165 |
165 It has no further properties. |
166 It has no further properties. |
166 */ |
167 */ |
167 |
|
168 /*! |
|
169 \internal |
|
170 \class QDeclarativeParticleMotionLinear |
|
171 \ingroup group_effects |
|
172 \brief The QDeclarativeParticleMotionLinear class moves the particles linearly. |
|
173 */ |
|
174 |
|
175 void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int interval) |
168 void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int interval) |
176 { |
169 { |
177 p.x += interval * p.x_velocity; |
170 p.x += interval * p.x_velocity; |
178 p.y += interval * p.y_velocity; |
171 p.y += interval * p.y_velocity; |
179 } |
172 } |
180 |
173 |
181 /*! |
174 /*! |
182 \qmlclass ParticleMotionGravity QDeclarativeParticleMotionGravity |
175 \qmlclass ParticleMotionGravity QDeclarativeParticleMotionGravity |
|
176 \ingroup qml-particle-elements |
183 \since 4.7 |
177 \since 4.7 |
184 \brief The ParticleMotionGravity object moves particles towards a point. |
178 \brief The ParticleMotionGravity object moves particles towards a point. |
185 |
179 |
186 This motion attracts the particles to the specified point with the specified acceleration. |
180 This motion attracts the particles to the specified point with the specified acceleration. |
187 To mimic earth gravity, set yattractor to -6360000 and acceleration to 9.8. |
181 To mimic earth gravity, set yattractor to -6360000 and acceleration to 9.8. |
189 The defaults are all 0, not earth gravity, and so no motion will occur without setting |
183 The defaults are all 0, not earth gravity, and so no motion will occur without setting |
190 at least the acceleration property. |
184 at least the acceleration property. |
191 |
185 |
192 |
186 |
193 \sa Particles |
187 \sa Particles |
194 */ |
|
195 |
|
196 /*! |
|
197 \internal |
|
198 \class QDeclarativeParticleMotionGravity |
|
199 \ingroup group_effects |
|
200 \brief The QDeclarativeParticleMotionGravity class moves the particles towards a point. |
|
201 |
|
202 */ |
188 */ |
203 |
189 |
204 /*! |
190 /*! |
205 \qmlproperty real ParticleMotionGravity::xattractor |
191 \qmlproperty real ParticleMotionGravity::xattractor |
206 \qmlproperty real ParticleMotionGravity::yattractor |
192 \qmlproperty real ParticleMotionGravity::yattractor |
269 p.y += interval * p.y_velocity; |
255 p.y += interval * p.y_velocity; |
270 } |
256 } |
271 |
257 |
272 /*! |
258 /*! |
273 \qmlclass ParticleMotionWander QDeclarativeParticleMotionWander |
259 \qmlclass ParticleMotionWander QDeclarativeParticleMotionWander |
|
260 \ingroup qml-particle-elements |
274 \since 4.7 |
261 \since 4.7 |
275 \brief The ParticleMotionWander object moves particles in a somewhat random fashion. |
262 \brief The ParticleMotionWander object moves particles in a somewhat random fashion. |
276 |
263 |
277 The particles will continue roughly in the original direction, however will randomly |
264 The particles will continue roughly in the original direction, however will randomly |
278 drift to each side. |
265 drift to each side. |
703 } |
681 } |
704 \endqml |
682 \endqml |
705 \image particles.gif |
683 \image particles.gif |
706 */ |
684 */ |
707 |
685 |
708 /*! |
|
709 \internal |
|
710 \class QDeclarativeParticles |
|
711 \ingroup group_effects |
|
712 \brief The QDeclarativeParticles class generates and moves particles. |
|
713 */ |
|
714 |
|
715 QDeclarativeParticles::QDeclarativeParticles(QDeclarativeItem *parent) |
686 QDeclarativeParticles::QDeclarativeParticles(QDeclarativeItem *parent) |
716 : QDeclarativeItem(*(new QDeclarativeParticlesPrivate), parent) |
687 : QDeclarativeItem(*(new QDeclarativeParticlesPrivate), parent) |
717 { |
688 { |
718 Q_D(QDeclarativeParticles); |
689 Q_D(QDeclarativeParticles); |
719 d->init(); |
690 d->init(); |