Commit dbe4d201 authored by Alan Alpert's avatar Alan Alpert Committed by Qt by Nokia
Browse files

Particle example restyling


For self-contained particle systems, placing them inside the
ParticleSystem element is encouraged.

Change-Id: Iafc5a94bb07c4c0dac0daec300d01e0fde165146
Reviewed-by: default avatarYann Bodson <yann.bodson@nokia.com>
Reviewed-by: default avatarAlan Alpert <alan.alpert@nokia.com>
parent bd2493e2
dev 5.10 5.11 5.12 5.12.1 5.12.10 5.12.11 5.12.12 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.13 5.13.0 5.13.1 5.13.2 5.14 5.14.0 5.14.1 5.14.2 5.15 5.15.0 5.15.1 5.15.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.9.8 6.0 6.0.0 6.1 6.1.0 6.1.1 6.1.2 6.1.3 6.2 6.2.0 6.2.1 6.2.2 old/5.0 old/5.1 old/5.2 wip/cmake wip/dbus wip/gc wip/itemviews wip/nacl wip/new-backend wip/pointerhandler wip/propertycache-refactor wip/qquickdeliveryagent wip/scenegraphng wip/tizen wip/webassembly v5.15.0-alpha1 v5.14.1 v5.14.0 v5.14.0-rc2 v5.14.0-rc1 v5.14.0-beta3 v5.14.0-beta2 v5.14.0-beta1 v5.14.0-alpha1 v5.13.2 v5.13.1 v5.13.0 v5.13.0-rc3 v5.13.0-rc2 v5.13.0-rc1 v5.13.0-beta4 v5.13.0-beta3 v5.13.0-beta2 v5.13.0-beta1 v5.13.0-alpha1 v5.12.7 v5.12.6 v5.12.5 v5.12.4 v5.12.3 v5.12.2 v5.12.1 v5.12.0 v5.12.0-rc2 v5.12.0-rc1 v5.12.0-beta4 v5.12.0-beta3 v5.12.0-beta2 v5.12.0-beta1 v5.12.0-alpha1 v5.11.3 v5.11.2 v5.11.1 v5.11.0 v5.11.0-rc2 v5.11.0-rc1 v5.11.0-beta4 v5.11.0-beta3 v5.11.0-beta2 v5.11.0-beta1 v5.11.0-alpha1 v5.10.1 v5.10.0 v5.10.0-rc3 v5.10.0-rc2 v5.10.0-rc1 v5.10.0-beta4 v5.10.0-beta3 v5.10.0-beta2 v5.10.0-beta1 v5.10.0-alpha1 v5.9.9 v5.9.8 v5.9.7 v5.9.6 v5.9.5 v5.9.4 v5.9.3 v5.9.2 v5.9.1 v5.9.0 v5.9.0-rc2 v5.9.0-rc1 v5.9.0-beta4 v5.9.0-beta3 v5.9.0-beta2 v5.9.0-beta1 v5.9.0-alpha1 v5.8.0 v5.8.0-rc1 v5.8.0-beta1 v5.8.0-alpha1 v5.7.1 v5.7.0 v5.7.0-rc1 v5.7.0-beta1 v5.7.0-alpha1 v5.6.3 v5.6.2 v5.6.1 v5.6.1-1 v5.6.0 v5.6.0-rc1 v5.6.0-beta1 v5.6.0-alpha1 v5.5.1 v5.5.0 v5.5.0-rc1 v5.5.0-beta1 v5.5.0-alpha1 v5.4.2 v5.4.1 v5.4.0 v5.4.0-rc1 v5.4.0-beta1 v5.4.0-alpha1 v5.3.2 v5.3.1 v5.3.0 v5.3.0-rc1 v5.3.0-beta1 v5.3.0-alpha1 v5.2.1 v5.2.0 v5.2.0-rc1 v5.2.0-beta1 v5.2.0-alpha1 v5.1.1 v5.1.0 v5.1.0-rc2 v5.1.0-rc1 v5.1.0-beta1 v5.1.0-alpha1 v5.0.2 v5.0.1 v5.0.0 v5.0.0-rc2 v5.0.0-rc1 v5.0.0-beta2 v5.0.0-beta1
No related merge requests found
Showing with 604 additions and 640 deletions
...@@ -55,50 +55,44 @@ Item { ...@@ -55,50 +55,44 @@ Item {
} }
ParticleSystem { ParticleSystem {
id: particles
}
ImageParticle {
id: cloud
anchors.fill: parent anchors.fill: parent
system: particles ImageParticle {
source: "gfx/cloud.png" id: cloud
alphaVariation: 0.25 source: "gfx/cloud.png"
opacity: 0.25 alphaVariation: 0.25
smooth: true opacity: 0.25
} smooth: true
}
Wander { Wander {
system: particles xVariance: 100;
anchors.fill: parent pace: 1;
xVariance: 100; }
pace: 1;
}
Emitter { Emitter {
id: cloudLeft id: cloudLeft
system: particles width: 160
width: 160 height: 160
height: 160 anchors.right: parent.left
anchors.right: parent.left emitRate: 0.5
emitRate: 0.5 lifeSpan: 12000
lifeSpan: 12000 velocity: PointDirection{ x: 64; xVariation: 2; yVariation: 2 }
velocity: PointDirection{ x: 64; xVariation: 2; yVariation: 2 } size: 160
size: 160 }
}
Emitter { Emitter {
id: cloudRight id: cloudRight
system: particles width: 160
width: 160 height: 160
height: 160 anchors.left: parent.right
anchors.left: parent.right emitRate: 0.5
emitRate: 0.5 lifeSpan: 12000
lifeSpan: 12000 velocity: PointDirection{ x: -64; xVariation: 2; yVariation: 2 }
velocity: PointDirection{ x: -64; xVariation: 2; yVariation: 2 } size: 160
size: 160 }
} }
Text { Text {
visible: gameCanvas != undefined visible: gameCanvas != undefined
text: "You saved " + gameCanvas.score + " fishes!" text: "You saved " + gameCanvas.score + " fishes!"
......
...@@ -56,42 +56,37 @@ Item { ...@@ -56,42 +56,37 @@ Item {
ParticleSystem { ParticleSystem {
id: particles id: particles
}
ImageParticle {
id: bubble
anchors.fill: parent
system: particles
source: "content/gfx/catch.png"
opacity: 0.25
smooth: true
}
Wander {
system: particles
anchors.fill: parent anchors.fill: parent
xVariance: 25;
pace: 25;
}
Emitter { ImageParticle {
id: fire id: bubble
system: particles anchors.fill: parent
source: "content/gfx/catch.png"
opacity: 0.25
smooth: true
}
width: parent.width Wander {
height: 150 xVariance: 25;
anchors.bottom: parent.bottom pace: 25;
anchors.bottomMargin: 3 }
startTime: 15000
emitRate: 2 Emitter {
lifeSpan: 15000 width: parent.width
height: 150
anchors.bottom: parent.bottom
anchors.bottomMargin: 3
startTime: 15000
acceleration: PointDirection{ y: -6; xVariation: 2; yVariation: 2 } emitRate: 2
lifeSpan: 15000
size: 24 acceleration: PointDirection{ y: -6; xVariation: 2; yVariation: 2 }
sizeVariation: 16
}
size: 24
sizeVariation: 16
}
}
} }
Column { Column {
......
...@@ -50,150 +50,141 @@ Rectangle { ...@@ -50,150 +50,141 @@ Rectangle {
source: "../../images/finalfrontier.png" source: "../../images/finalfrontier.png"
anchors.centerIn:parent anchors.centerIn:parent
} }
Emitter {
group: "stars"
system: particles
emitRate: 40
lifeSpan: 4000
enabled: true
size: 30
sizeVariation: 10
velocity: PointDirection { x: 220; xVariation: 40 }
height: parent.height
}
Emitter {
group: "roids"
system: particles
emitRate: 10
lifeSpan: 4000
enabled: true
size: 30
sizeVariation: 10
velocity: PointDirection { x: 220; xVariation: 40 }
height: parent.height
}
ParticleSystem { ParticleSystem {
id: particles id: particles
anchors.fill: parent anchors.fill: parent
}
ImageParticle { Emitter {
id: stars group: "stars"
groups: ["stars"] emitRate: 40
system: particles lifeSpan: 4000
source: "../../images/star.png" enabled: true
color: "white" size: 30
colorVariation: 0.1 sizeVariation: 10
alpha: 0 velocity: PointDirection { x: 220; xVariation: 40 }
} height: parent.height
ImageParticle {
id: roids
groups: ["roids"]
system: particles
sprites: Sprite {
id: spinState
name: "spinning"
source: "../../images/meteor.png"
frameCount: 35
frameDuration: 60
} }
} Emitter {
ImageParticle { group: "roids"
id: shot emitRate: 10
groups: ["shot"] lifeSpan: 4000
system: particles enabled: true
source: "../../images/star.png" size: 30
sizeVariation: 10
velocity: PointDirection { x: 220; xVariation: 40 }
height: parent.height
}
ImageParticle {
id: stars
groups: ["stars"]
source: "../../images/star.png"
color: "white"
colorVariation: 0.1
alpha: 0
}
ImageParticle {
id: roids
groups: ["roids"]
sprites: Sprite {
id: spinState
name: "spinning"
source: "../../images/meteor.png"
frameCount: 35
frameDuration: 60
}
}
ImageParticle {
id: shot
groups: ["shot"]
source: "../../images/star.png"
color: "#0FF06600" color: "#0FF06600"
colorVariation: 0.3 colorVariation: 0.3
} }
ImageParticle { ImageParticle {
id: engine id: engine
groups: ["engine"] groups: ["engine"]
system: particles source: "../../images/particle4.png"
source: "../../images/particle4.png"
color: "orange" color: "orange"
SequentialAnimation on color { SequentialAnimation on color {
loops: Animation.Infinite loops: Animation.Infinite
ColorAnimation { ColorAnimation {
from: "red" from: "red"
to: "cyan" to: "cyan"
duration: 1000 duration: 1000
} }
ColorAnimation { ColorAnimation {
from: "cyan" from: "cyan"
to: "red" to: "red"
duration: 1000 duration: 1000
}
} }
}
colorVariation: 0.2 colorVariation: 0.2
} }
//! [0] //! [0]
Attractor { Attractor {
id: gs; pointX: root.width/2; pointY: root.height/2; strength: 4000000; id: gs; pointX: root.width/2; pointY: root.height/2; strength: 4000000;
system: particles affectedParameter: Attractor.Acceleration
affectedParameter: Attractor.Acceleration proportionalToDistance: Attractor.InverseQuadratic
proportionalToDistance: Attractor.InverseQuadratic }
} //! [0]
//! [0] Age {
Age { x: gs.pointX - 8;
system: particles y: gs.pointY - 8;
x: gs.pointX - 8; width: 16
y: gs.pointY - 8; height: 16
width: 16 }
height: 16 Rectangle {
} color: "black"
Rectangle { width: 8
color: "black" height: 8
width: 8 radius: 4
height: 8 x: gs.pointX - 4
radius: 4 y: gs.pointY - 4
x: gs.pointX - 4 }
y: gs.pointY - 4
}
Image { Image {
source:"../../images/rocket2.png" source:"../../images/rocket2.png"
id: ship id: ship
width: 45 width: 45
height: 22 height: 22
//Automatic movement //Automatic movement
SequentialAnimation on x { SequentialAnimation on x {
loops: -1 loops: -1
NumberAnimation{to: root.width-45; easing.type: Easing.InOutQuad; duration: 2000} NumberAnimation{to: root.width-45; easing.type: Easing.InOutQuad; duration: 2000}
NumberAnimation{to: 0; easing.type: Easing.OutInQuad; duration: 6000} NumberAnimation{to: 0; easing.type: Easing.OutInQuad; duration: 6000}
}
SequentialAnimation on y {
loops: -1
NumberAnimation{to: root.height-22; easing.type: Easing.OutInQuad; duration: 6000}
NumberAnimation{to: 0; easing.type: Easing.InOutQuad; duration: 2000}
}
} }
SequentialAnimation on y { Emitter {
loops: -1 group: "engine"
NumberAnimation{to: root.height-22; easing.type: Easing.OutInQuad; duration: 6000} emitRate: 200
NumberAnimation{to: 0; easing.type: Easing.InOutQuad; duration: 2000} lifeSpan: 1000
size: 10
endSize: 4
sizeVariation: 4
velocity: PointDirection { x: -128; xVariation: 32 }
height: ship.height
y: ship.y
x: ship.x
width: 20
}
Emitter {
group: "shot"
emitRate: 32
lifeSpan: 1000
enabled: true
size: 40
velocity: PointDirection { x: 256; }
x: ship.x + ship.width
y: ship.y + ship.height/2
} }
}
Emitter {
group: "engine"
system: particles
emitRate: 200
lifeSpan: 1000
size: 10
endSize: 4
sizeVariation: 4
velocity: PointDirection { x: -128; xVariation: 32 }
height: ship.height
y: ship.y
x: ship.x
width: 20
}
Emitter {
group: "shot"
system: particles
emitRate: 32
lifeSpan: 1000
enabled: true
size: 40
velocity: PointDirection { x: 256; }
x: ship.x + ship.width
y: ship.y + ship.height/2
} }
} }
...@@ -50,127 +50,118 @@ Item { ...@@ -50,127 +50,118 @@ Item {
anchors.fill: parent anchors.fill: parent
} }
ParticleSystem { ParticleSystem {
id: sys
}
Emitter {
system: sys
width: parent.width
emitRate: 4
lifeSpan: 14000
size: 80
velocity: PointDirection { y: 60 }
}
Wander {
system: sys
anchors.fill: parent anchors.fill: parent
anchors.bottomMargin: 100 Emitter {
xVariance: 60 width: parent.width
pace: 60 emitRate: 4
} lifeSpan: 14000
size: 80
velocity: PointDirection { y: 60 }
}
Wander {
anchors.fill: parent
anchors.bottomMargin: 100
xVariance: 60
pace: 60
}
//! [0] //! [0]
Affector { Affector {
system: sys property real coefficient: 0.1
property real coefficient: 0.1 property real velocity: 1.5
property real velocity: 1.5 width: parent.width
width: parent.width height: parent.height - 100
height: parent.height - 100 onAffectParticles: {
onAffectParticles: { /* //Linear movement
/* //Linear movement if (particle.r == 0) {
if (particle.r == 0) { particle.r = Math.random() > 0.5 ? -1 : 1;
particle.r = Math.random() > 0.5 ? -1 : 1; } else if (particle.r == 1) {
}else if (particle.r == 1) { particle.rotation += velocity * dt;
particle.rotation += velocity * dt; if (particle.rotation >= maxAngle)
if(particle.rotation >= maxAngle) particle.r = -1;
particle.r = -1; } else if (particle.r == -1) {
}else if (particle.r == -1) { particle.rotation -= velocity * dt;
particle.rotation -= velocity * dt; if (particle.rotation <= -1 * maxAngle)
if(particle.rotation <= -1 * maxAngle) particle.r = 1;
particle.r = 1; }
} */
*/ //Wobbly movement
//Wobbly movement for (var i=0; i<particles.length; i++) {
for (var i=0; i<particles.length; i++) { var particle = particles[i];
var particle = particles[i]; if (particle.r == 0.0) {
if (particle.r == 0.0) { particle.r = Math.random() + 0.01;
particle.r = Math.random() + 0.01; }
particle.rotation += velocity * particle.r * dt;
particle.r -= particle.rotation * coefficient;
if (particle.r == 0.0)
particle.r -= particle.rotation * 0.000001;
particle.update = 1;
} }
particle.rotation += velocity * particle.r * dt;
particle.r -= particle.rotation * coefficient;
if (particle.r == 0.0)
particle.r -= particle.rotation * 0.000001;
particle.update = 1;
} }
} }
} //! [0]
//! [0]
//! [1] //! [1]
Affector {//Custom Friction, adds some 'randomness' Affector {//Custom Friction, adds some 'randomness'
system: sys x: -60
x: -60 width: parent.width + 120
width: parent.width + 120 height: 100
height: 100 anchors.bottom: parent.bottom
anchors.bottom: parent.bottom onAffectParticles: {
onAffectParticles: { for (var i=0; i<particles.length; i++) {
for (var i=0; i<particles.length; i++) { var particle = particles[i];
var particle = particles[i]; var pseudoRand = (Math.floor(particle.t*1327) % 10) + 1;
var pseudoRand = (Math.floor(particle.t*1327) % 10) + 1; var yslow = dt * pseudoRand * 0.5 + 1;
var yslow = dt * pseudoRand * 0.5 + 1; var xslow = dt * pseudoRand * 0.05 + 1;
var xslow = dt * pseudoRand * 0.05 + 1; if (particle.vy < 1)
if (particle.vy < 1) particle.vy = 0;
particle.vy = 0; else
else particle.vy = (particle.vy / yslow);
particle.vy = (particle.vy / yslow); if (particle.vx < 1)
if (particle.vx < 1) particle.vx = 0;
particle.vx = 0; else
else particle.vx = (particle.vx / xslow);
particle.vx = (particle.vx / xslow); particle.update = true;
particle.update = true; }
} }
} }
} //! [1]
//! [1]
ImageParticle { ImageParticle {
anchors.fill: parent anchors.fill: parent
id: particles id: particles
system: sys sprites: [Sprite {
sprites: [Sprite { source: "../../images/realLeaf1.png"
source: "../../images/realLeaf1.png" frameCount: 1
frameCount: 1 frameDuration: 1
frameDuration: 1 to: {"a":1, "b":1, "c":1, "d":1}
to: {"a":1, "b":1, "c":1, "d":1} }, Sprite {
}, Sprite { name: "a"
name: "a" source: "../../images/realLeaf1.png"
source: "../../images/realLeaf1.png" frameCount: 1
frameCount: 1 frameDuration: 10000
frameDuration: 10000 },
}, Sprite {
Sprite { name: "b"
name: "b" source: "../../images/realLeaf2.png"
source: "../../images/realLeaf2.png" frameCount: 1
frameCount: 1 frameDuration: 10000
frameDuration: 10000 },
}, Sprite {
Sprite { name: "c"
name: "c" source: "../../images/realLeaf3.png"
source: "../../images/realLeaf3.png" frameCount: 1
frameCount: 1 frameDuration: 10000
frameDuration: 10000 },
}, Sprite {
Sprite { name: "d"
name: "d" source: "../../images/realLeaf4.png"
source: "../../images/realLeaf4.png" frameCount: 1
frameCount: 1 frameDuration: 10000
frameDuration: 10000 }
} ]
]
width: 100 z:4
height: 100 }
x: 20
y: 20
z:4
} }
} }
...@@ -49,64 +49,63 @@ Item { ...@@ -49,64 +49,63 @@ Item {
source: "../../images/backgroundLeaves.jpg" source: "../../images/backgroundLeaves.jpg"
anchors.fill: parent anchors.fill: parent
} }
ParticleSystem { id: sys } ParticleSystem {
Emitter {
system: sys
width: parent.width
emitRate: 4
lifeSpan: 14000
size: 80
velocity: PointDirection { y: 160; yVariation: 80; xVariation: 20 }
}
ImageParticle {
anchors.fill: parent anchors.fill: parent
id: particles Emitter {
system: sys width: parent.width
sprites: [Sprite { emitRate: 4
source: "../../images/realLeaf1.png" lifeSpan: 14000
frameCount: 1 size: 80
frameDuration: 1 velocity: PointDirection { y: 160; yVariation: 80; xVariation: 20 }
to: {"a":1, "b":1, "c":1, "d":1} }
}, Sprite {
name: "a"
source: "../../images/realLeaf1.png"
frameCount: 1
frameDuration: 10000
},
Sprite {
name: "b"
source: "../../images/realLeaf2.png"
frameCount: 1
frameDuration: 10000
},
Sprite {
name: "c"
source: "../../images/realLeaf3.png"
frameCount: 1
frameDuration: 10000
},
Sprite {
name: "d"
source: "../../images/realLeaf4.png"
frameCount: 1
frameDuration: 10000
}
]
width: 100 ImageParticle {
height: 100 anchors.fill: parent
x: 20 id: particles
y: 20 sprites: [Sprite {
z:4 source: "../../images/realLeaf1.png"
} frameCount: 1
frameDuration: 1
to: {"a":1, "b":1, "c":1, "d":1}
}, Sprite {
name: "a"
source: "../../images/realLeaf1.png"
frameCount: 1
frameDuration: 10000
},
Sprite {
name: "b"
source: "../../images/realLeaf2.png"
frameCount: 1
frameDuration: 10000
},
Sprite {
name: "c"
source: "../../images/realLeaf3.png"
frameCount: 1
frameDuration: 10000
},
Sprite {
name: "d"
source: "../../images/realLeaf4.png"
frameCount: 1
frameDuration: 10000
}
]
//! [0] width: 100
Friction { height: 100
anchors.fill: parent x: 20
anchors.margins: -40 y: 20
system: sys z:4
factor: 0.4 }
//! [0]
Friction {
anchors.fill: parent
anchors.margins: -40
factor: 0.4
}
//! [0]
} }
//! [0]
} }
...@@ -54,85 +54,79 @@ Rectangle { ...@@ -54,85 +54,79 @@ Rectangle {
anchors.horizontalCenterOffset: 2 anchors.horizontalCenterOffset: 2
} }
ParticleSystem { ParticleSystem {
id: ps
}
MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: turb.enabled = !turb.enabled MouseArea {
} anchors.fill: parent
onClicked: turb.enabled = !turb.enabled
}
//! [0] //! [0]
Turbulence { Turbulence {
id: turb id: turb
system: ps enabled: true
enabled: true height: (parent.height / 2) - 4
height: (parent.height / 2) - 4 width: parent.width
width: parent.width x: parent. width / 4
x: parent. width / 4 anchors.fill: parent
anchors.fill: parent strength: 32
strength: 32 NumberAnimation on strength{from: 16; to: 64; easing.type: Easing.InOutBounce; duration: 1800; loops: -1}
NumberAnimation on strength{from: 16; to: 64; easing.type: Easing.InOutBounce; duration: 1800; loops: -1} }
} //! [0]
//! [0]
ImageParticle { ImageParticle {
groups: ["smoke"] groups: ["smoke"]
system: ps source: "../../images/particle.png"
source: "../../images/particle.png" color: "#11111111"
color: "#11111111" colorVariation: 0
colorVariation: 0 }
} ImageParticle {
ImageParticle { groups: ["flame"]
groups: ["flame"] source: "../../images/particle.png"
system: ps color: "#11ff400f"
source: "../../images/particle.png" colorVariation: 0.1
color: "#11ff400f" }
colorVariation: 0.1 Emitter {
} anchors.centerIn: parent
Emitter { group: "flame"
anchors.centerIn: parent
system: ps
group: "flame"
emitRate: 120
lifeSpan: 1200
size: 20
endSize: 10
sizeVariation: 10
acceleration: PointDirection { y: -40 }
velocity: AngleDirection { angle: 270; magnitude: 20; angleVariation: 22; magnitudeVariation: 5 }
}
TrailEmitter {
id: smoke1
width: root.width
height: root.height/2
system: ps
group: "smoke"
follow: "flame"
emitRatePerParticle: 1 emitRate: 120
lifeSpan: 2400 lifeSpan: 1200
lifeSpanVariation: 400 size: 20
size: 16 endSize: 10
endSize: 8 sizeVariation: 10
sizeVariation: 8 acceleration: PointDirection { y: -40 }
acceleration: PointDirection { y: -40 } velocity: AngleDirection { angle: 270; magnitude: 20; angleVariation: 22; magnitudeVariation: 5 }
velocity: AngleDirection { angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 } }
} TrailEmitter {
TrailEmitter { id: smoke1
id: smoke2 width: root.width
width: root.width height: root.height/2
height: root.height/2 - 20 group: "smoke"
system: ps follow: "flame"
group: "smoke"
follow: "flame" emitRatePerParticle: 1
lifeSpan: 2400
emitRatePerParticle: 4 lifeSpanVariation: 400
lifeSpan: 2400 size: 16
size: 36 endSize: 8
endSize: 24 sizeVariation: 8
sizeVariation: 12 acceleration: PointDirection { y: -40 }
acceleration: PointDirection { y: -40 } velocity: AngleDirection { angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 }
velocity: AngleDirection { angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 } }
TrailEmitter {
id: smoke2
width: root.width
height: root.height/2 - 20
group: "smoke"
follow: "flame"
emitRatePerParticle: 4
lifeSpan: 2400
size: 36
endSize: 24
sizeVariation: 12
acceleration: PointDirection { y: -40 }
velocity: AngleDirection { angle: 270; magnitude: 40; angleVariation: 22; magnitudeVariation: 5 }
}
} }
} }
...@@ -47,35 +47,36 @@ Rectangle { ...@@ -47,35 +47,36 @@ Rectangle {
height: 540 height: 540
ParticleSystem { ParticleSystem {
id: sys id: sys
anchors.fill: parent
onEmptyChanged: if (empty) sys.pause(); onEmptyChanged: if (empty) sys.pause();
}
ImageParticle { ImageParticle {
system: sys system: sys
id: cp id: cp
source: "../../images/particle.png" source: "../../images/particle.png"
colorVariation: 0.4 colorVariation: 0.4
color: "#000000FF" color: "#000000FF"
} }
Emitter { Emitter {
//burst on click //burst on click
id: bursty id: bursty
system: sys system: sys
enabled: ma.pressed enabled: ma.pressed
x: ma.mouseX x: ma.mouseX
y: ma.mouseY y: ma.mouseY
emitRate: 16000 emitRate: 16000
maximumEmitted: 4000 maximumEmitted: 4000
acceleration: AngleDirection {angleVariation: 360; magnitude: 360; } acceleration: AngleDirection {angleVariation: 360; magnitude: 360; }
size: 8 size: 8
endSize: 16 endSize: 16
sizeVariation: 4 sizeVariation: 4
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onPressed: sys.resume() onPressed: sys.resume()
id: ma id: ma
}
} }
} }
...@@ -53,62 +53,60 @@ Rectangle { ...@@ -53,62 +53,60 @@ Rectangle {
ParticleSystem { ParticleSystem {
id: particles id: particles
}
ImageParticle {
groups: ["center","edge"]
anchors.fill: parent anchors.fill: parent
system: particles
source: "../../images/particle.png"
colorVariation: 0.1
color: "#009999FF"
}
Emitter { ImageParticle {
anchors.fill: parent groups: ["center","edge"]
group: "center" anchors.fill: parent
system: particles source: "../../images/particle.png"
emitRate: 400 colorVariation: 0.1
lifeSpan: 2000 color: "#009999FF"
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]
}
Emitter { Emitter {
anchors.fill: parent anchors.fill: parent
group: "edge" group: "center"
startTime: 2000 emitRate: 400
system: particles lifeSpan: 2000
emitRate: 2000 size: 20
lifeSpan: 2000 sizeVariation: 2
size: 28 endSize: 0
sizeVariation: 2 //! [0]
endSize: 16 shape: EllipseShape {fill: false}
shape: EllipseShape {fill: false} velocity: TargetDirection {
velocity: TargetDirection { targetX: root.width/2
targetX: root.width/2 targetY: root.height/2
targetY: root.height/2 proportionalMagnitude: true
proportionalMagnitude: true magnitude: 0.5
magnitude: 0.1 }
magnitudeVariation: 0.1 //! [0]
} }
acceleration: TargetDirection {
targetX: root.width/2 Emitter {
targetY: root.height/2 anchors.fill: parent
targetVariation: 200 group: "edge"
proportionalMagnitude: true startTime: 2000
magnitude: 0.1 emitRate: 2000
magnitudeVariation: 0.1 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
}
} }
} }
} }
...@@ -49,127 +49,128 @@ Rectangle { ...@@ -49,127 +49,128 @@ Rectangle {
ParticleSystem { ParticleSystem {
id: particles 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 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 { ImageParticle {
id: balls id: smoke
system: particles system: particles
group: "E" anchors.fill: parent
groups: ["A", "B"]
y: parent.height source: "../../images/particle.png"
width: parent.width colorVariation: 0
color: "#00111111"
emitRate: 2 }
lifeSpan: 7000 ImageParticle {
id: flame
velocity: PointDirection {y:-17*4*2; xVariation: 6*6} anchors.fill: parent
acceleration: PointDirection {y: 17*2; xVariation: 6*6} system: particles
groups: ["C", "D"]
size: 8 source: "../../images/particle.png"
sizeVariation: 4 colorVariation: 0.1
} color: "#00ff400f"
}
Turbulence { //A bit of turbulence makes the smoke look better
anchors.fill: parent Emitter {
groups: ["A","B"] id: fire
strength: 32 system: particles
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
}
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment