diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2012-06-07 13:23:56 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-25 07:29:42 +0200 |
commit | 3ff503fb86222ebcfc882b7c1d79fd42a7b53cfc (patch) | |
tree | ebc9c2b37167dc275c34d0c62e4c758341a9d4d3 /examples/particles | |
parent | 0c64967cf3317d4c9863da3c2fe130f93b27eefa (diff) |
Delay custom emitter processing
It now happens after ParticlePainter intialization, so that custom
emitters can affect painter specific parameters like color.
Change-Id: I9a732713108580e57130588c175c69aa854c5b2f
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'examples/particles')
-rw-r--r-- | examples/particles/emitters/customemitter.qml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/particles/emitters/customemitter.qml b/examples/particles/emitters/customemitter.qml index 757c836106..135b3d781c 100644 --- a/examples/particles/emitters/customemitter.qml +++ b/examples/particles/emitters/customemitter.qml @@ -72,7 +72,11 @@ ParticleSystem { 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); @@ -86,7 +90,5 @@ ParticleSystem { ImageParticle { source: "../images/particle4.png" alpha: 0.0 - redVariation: 0.6 - color: "white" } } |