for (var i=0; i<particles.length; i++) {
var particle = particles[i];
particle.startSize = Math.max(02,Math.min(492,Math.tan(particle.t/2)*24));
- var theta = Math.floor(Math.random() * 6.0) / 6.0;
+ var theta = Math.floor(Math.random() * 6.0);
+ particle.red = theta == 0 || theta == 1 || theta == 2 ? 0.2 : 1;
+ particle.green = theta == 2 || theta == 3 || theta == 4 ? 0.2 : 1;
+ particle.blue = theta == 4 || theta == 5 || theta == 0 ? 0.2 : 1;
+ theta /= 6.0;
theta *= 2.0*Math.PI;
theta += sys.convert(sys.petalRotation);
particle.initialVX = petalLength * Math.cos(theta);
ImageParticle {
source: "../images/particle4.png"
alpha: 0.0
- redVariation: 0.6
- color: "white"
}
}
}
}
+ foreach (QQuickParticleData* d, toEmit)
+ m_system->emitParticle(d);
+
if (isEmitConnected()) {
+ //Done after emitParticle so that the Painter::load is done first, this allows you to customize its static variables
+ //We then don't need to request another reload, because the first reload isn't scheduled until we get back to the render thread
v8::HandleScope handle_scope;
v8::Context::Scope scope(QQmlEnginePrivate::getV8Engine(qmlEngine(this))->context());
v8::Handle<v8::Array> array = v8::Array::New(toEmit.size());
emitParticles(QQmlV8Handle::fromHandle(array));//A chance for arbitrary JS changes
}
- foreach (QQuickParticleData* d, toEmit)
- m_system->emitParticle(d);
m_last_emission = pt;
\qmlproperty real QtQuick.Particles2::TrailEmitter::emitRatePerParticle
*/
/*!
- \qmlsignal QtQuick.Particles2::TrailEmitter::emitFollowParticles(Array particles, real followed)
+ \qmlsignal QtQuick.Particles2::TrailEmitter::emitFollowParticles(Array particles, QtQuick.Particles2::Particle followed)
This handler is called when particles are emitted from the \a followed particle. \a particles contains an array of particle objects which can be directly manipulated.
}
}
+ foreach (QQuickParticleData* d, toEmit)
+ m_system->emitParticle(d);
+
if (isEmitConnected() || isEmitFollowConnected()) {
v8::HandleScope handle_scope;
v8::Context::Scope scope(QQmlEnginePrivate::getV8Engine(qmlEngine(this))->context());
else if (isEmitConnected())
emitParticles(QQmlV8Handle::fromHandle(array));//A chance for arbitrary JS changes
}
- foreach (QQuickParticleData* d, toEmit)
- m_system->emitParticle(d);
m_lastEmission[d->index] = pt;
}