aboutsummaryrefslogtreecommitdiffstats
path: root/examples/particles/emitters/content
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2012-07-17 18:32:16 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-24 05:01:59 +0200
commitdbe4d2010816f1f22f48f3f5bce0d15d3ad7a7e2 (patch)
treed8e205e14e5497411ee7dd3d9a3c569851b73fb6 /examples/particles/emitters/content
parentbd2493e21d7619e448b205f215777d1d7b023075 (diff)
Particle example restyling
For self-contained particle systems, placing them inside the ParticleSystem element is encouraged. Change-Id: Iafc5a94bb07c4c0dac0daec300d01e0fde165146 Reviewed-by: Yann Bodson <yann.bodson@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'examples/particles/emitters/content')
-rw-r--r--examples/particles/emitters/content/maximumemitted.qml53
-rw-r--r--examples/particles/emitters/content/shapeanddirection.qml100
-rw-r--r--examples/particles/emitters/content/trailemitter.qml239
3 files changed, 196 insertions, 196 deletions
diff --git a/examples/particles/emitters/content/maximumemitted.qml b/examples/particles/emitters/content/maximumemitted.qml
index b99814ce88..b008135ff1 100644
--- a/examples/particles/emitters/content/maximumemitted.qml
+++ b/examples/particles/emitters/content/maximumemitted.qml
@@ -47,35 +47,36 @@ Rectangle {
height: 540
ParticleSystem {
id: sys
+ anchors.fill: parent
onEmptyChanged: if (empty) sys.pause();
- }
- ImageParticle {
- system: sys
- id: cp
- source: "../../images/particle.png"
- colorVariation: 0.4
- color: "#000000FF"
- }
+ ImageParticle {
+ system: sys
+ id: cp
+ source: "../../images/particle.png"
+ colorVariation: 0.4
+ color: "#000000FF"
+ }
- Emitter {
- //burst on click
- id: bursty
- system: sys
- enabled: ma.pressed
- x: ma.mouseX
- y: ma.mouseY
- emitRate: 16000
- maximumEmitted: 4000
- acceleration: AngleDirection {angleVariation: 360; magnitude: 360; }
- size: 8
- endSize: 16
- sizeVariation: 4
- }
+ Emitter {
+ //burst on click
+ id: bursty
+ system: sys
+ enabled: ma.pressed
+ x: ma.mouseX
+ y: ma.mouseY
+ emitRate: 16000
+ maximumEmitted: 4000
+ acceleration: AngleDirection {angleVariation: 360; magnitude: 360; }
+ size: 8
+ endSize: 16
+ sizeVariation: 4
+ }
- MouseArea {
- anchors.fill: parent
- onPressed: sys.resume()
- id: ma
+ MouseArea {
+ anchors.fill: parent
+ onPressed: sys.resume()
+ id: ma
+ }
}
}
diff --git a/examples/particles/emitters/content/shapeanddirection.qml b/examples/particles/emitters/content/shapeanddirection.qml
index d2a8bb1dd5..96b4b60ee4 100644
--- a/examples/particles/emitters/content/shapeanddirection.qml
+++ b/examples/particles/emitters/content/shapeanddirection.qml
@@ -53,62 +53,60 @@ Rectangle {
ParticleSystem {
id: particles
- }
-
- ImageParticle {
- groups: ["center","edge"]
anchors.fill: parent
- system: particles
- source: "../../images/particle.png"
- colorVariation: 0.1
- color: "#009999FF"
- }
- Emitter {
- anchors.fill: parent
- group: "center"
- system: particles
- emitRate: 400
- lifeSpan: 2000
- size: 20
- sizeVariation: 2
- endSize: 0
- //! [0]
- shape: EllipseShape {fill: false}
- velocity: TargetDirection {
- targetX: root.width/2
- targetY: root.height/2
- proportionalMagnitude: true
- magnitude: 0.5
+ ImageParticle {
+ groups: ["center","edge"]
+ anchors.fill: parent
+ source: "../../images/particle.png"
+ colorVariation: 0.1
+ color: "#009999FF"
}
- //! [0]
- }
- Emitter {
- anchors.fill: parent
- group: "edge"
- startTime: 2000
- system: particles
- emitRate: 2000
- lifeSpan: 2000
- size: 28
- sizeVariation: 2
- endSize: 16
- shape: EllipseShape {fill: false}
- velocity: TargetDirection {
- targetX: root.width/2
- targetY: root.height/2
- proportionalMagnitude: true
- magnitude: 0.1
- magnitudeVariation: 0.1
+ Emitter {
+ anchors.fill: parent
+ group: "center"
+ emitRate: 400
+ lifeSpan: 2000
+ size: 20
+ sizeVariation: 2
+ endSize: 0
+ //! [0]
+ shape: EllipseShape {fill: false}
+ velocity: TargetDirection {
+ targetX: root.width/2
+ targetY: root.height/2
+ proportionalMagnitude: true
+ magnitude: 0.5
+ }
+ //! [0]
}
- acceleration: TargetDirection {
- targetX: root.width/2
- targetY: root.height/2
- targetVariation: 200
- proportionalMagnitude: true
- magnitude: 0.1
- magnitudeVariation: 0.1
+
+ Emitter {
+ anchors.fill: parent
+ group: "edge"
+ startTime: 2000
+ emitRate: 2000
+ lifeSpan: 2000
+ size: 28
+ sizeVariation: 2
+ endSize: 16
+ shape: EllipseShape {fill: false}
+ velocity: TargetDirection {
+ targetX: root.width/2
+ targetY: root.height/2
+ proportionalMagnitude: true
+ magnitude: 0.1
+ magnitudeVariation: 0.1
+ }
+ acceleration: TargetDirection {
+ targetX: root.width/2
+ targetY: root.height/2
+ targetVariation: 200
+ proportionalMagnitude: true
+ magnitude: 0.1
+ magnitudeVariation: 0.1
+ }
}
}
}
diff --git a/examples/particles/emitters/content/trailemitter.qml b/examples/particles/emitters/content/trailemitter.qml
index b225b59d6a..074f6d8160 100644
--- a/examples/particles/emitters/content/trailemitter.qml
+++ b/examples/particles/emitters/content/trailemitter.qml
@@ -49,127 +49,128 @@ Rectangle {
ParticleSystem {
id: particles
- }
-
- ImageParticle {
- id: smoke
- system: particles
- anchors.fill: parent
- groups: ["A", "B"]
- source: "../../images/particle.png"
- colorVariation: 0
- color: "#00111111"
- }
- ImageParticle {
- id: flame
- anchors.fill: parent
- system: particles
- groups: ["C", "D"]
- source: "../../images/particle.png"
- colorVariation: 0.1
- color: "#00ff400f"
- }
-
- Emitter {
- id: fire
- system: particles
- group: "C"
-
- y: parent.height
- width: parent.width
-
- emitRate: 350
- lifeSpan: 3500
-
- acceleration: PointDirection { y: -17; xVariation: 3 }
- velocity: PointDirection {xVariation: 3}
-
- size: 24
- sizeVariation: 8
- endSize: 4
- }
-
- TrailEmitter {
- id: fireSmoke
- group: "B"
- system: particles
- follow: "C"
- width: root.width
- height: root.height - 68
-
- emitRatePerParticle: 1
- lifeSpan: 2000
-
- velocity: PointDirection {y:-17*6; yVariation: -17; xVariation: 3}
- acceleration: PointDirection {xVariation: 3}
-
- size: 36
- sizeVariation: 8
- endSize: 16
- }
-
- TrailEmitter {
- id: fireballFlame
anchors.fill: parent
- system: particles
- group: "D"
- follow: "E"
-
- emitRatePerParticle: 120
- lifeSpan: 180
- emitWidth: TrailEmitter.ParticleSize
- emitHeight: TrailEmitter.ParticleSize
- emitShape: EllipseShape{}
-
- size: 16
- sizeVariation: 4
- endSize: 4
- }
-
- TrailEmitter {
- id: fireballSmoke
- anchors.fill: parent
- system: particles
- group: "A"
- follow: "E"
-
- emitRatePerParticle: 128
- lifeSpan: 2400
- emitWidth: TrailEmitter.ParticleSize
- emitHeight: TrailEmitter.ParticleSize
- emitShape: EllipseShape{}
-
- velocity: PointDirection {yVariation: 16; xVariation: 16}
- acceleration: PointDirection {y: -16}
-
- size: 24
- sizeVariation: 8
- endSize: 8
- }
- Emitter {
- id: balls
- system: particles
- group: "E"
-
- y: parent.height
- width: parent.width
-
- emitRate: 2
- lifeSpan: 7000
-
- velocity: PointDirection {y:-17*4*2; xVariation: 6*6}
- acceleration: PointDirection {y: 17*2; xVariation: 6*6}
-
- size: 8
- sizeVariation: 4
- }
-
- Turbulence { //A bit of turbulence makes the smoke look better
- anchors.fill: parent
- groups: ["A","B"]
- strength: 32
- system: particles
+ ImageParticle {
+ id: smoke
+ system: particles
+ anchors.fill: parent
+ groups: ["A", "B"]
+ source: "../../images/particle.png"
+ colorVariation: 0
+ color: "#00111111"
+ }
+ ImageParticle {
+ id: flame
+ anchors.fill: parent
+ system: particles
+ groups: ["C", "D"]
+ source: "../../images/particle.png"
+ colorVariation: 0.1
+ color: "#00ff400f"
+ }
+
+ Emitter {
+ id: fire
+ system: particles
+ group: "C"
+
+ y: parent.height
+ width: parent.width
+
+ emitRate: 350
+ lifeSpan: 3500
+
+ acceleration: PointDirection { y: -17; xVariation: 3 }
+ velocity: PointDirection {xVariation: 3}
+
+ size: 24
+ sizeVariation: 8
+ endSize: 4
+ }
+
+ TrailEmitter {
+ id: fireSmoke
+ group: "B"
+ system: particles
+ follow: "C"
+ width: root.width
+ height: root.height - 68
+
+ emitRatePerParticle: 1
+ lifeSpan: 2000
+
+ velocity: PointDirection {y:-17*6; yVariation: -17; xVariation: 3}
+ acceleration: PointDirection {xVariation: 3}
+
+ size: 36
+ sizeVariation: 8
+ endSize: 16
+ }
+
+ TrailEmitter {
+ id: fireballFlame
+ anchors.fill: parent
+ system: particles
+ group: "D"
+ follow: "E"
+
+ emitRatePerParticle: 120
+ lifeSpan: 180
+ emitWidth: TrailEmitter.ParticleSize
+ emitHeight: TrailEmitter.ParticleSize
+ emitShape: EllipseShape{}
+
+ size: 16
+ sizeVariation: 4
+ endSize: 4
+ }
+
+ TrailEmitter {
+ id: fireballSmoke
+ anchors.fill: parent
+ system: particles
+ group: "A"
+ follow: "E"
+
+ emitRatePerParticle: 128
+ lifeSpan: 2400
+ emitWidth: TrailEmitter.ParticleSize
+ emitHeight: TrailEmitter.ParticleSize
+ emitShape: EllipseShape{}
+
+ velocity: PointDirection {yVariation: 16; xVariation: 16}
+ acceleration: PointDirection {y: -16}
+
+ size: 24
+ sizeVariation: 8
+ endSize: 8
+ }
+
+ Emitter {
+ id: balls
+ system: particles
+ group: "E"
+
+ y: parent.height
+ width: parent.width
+
+ emitRate: 2
+ lifeSpan: 7000
+
+ velocity: PointDirection {y:-17*4*2; xVariation: 6*6}
+ acceleration: PointDirection {y: 17*2; xVariation: 6*6}
+
+ size: 8
+ sizeVariation: 4
+ }
+
+ Turbulence { //A bit of turbulence makes the smoke look better
+ anchors.fill: parent
+ groups: ["A","B"]
+ strength: 32
+ system: particles
+ }
}
}