aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/particles/imageparticle
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/particles/imageparticle')
-rw-r--r--examples/declarative/particles/imageparticle/allatonce.qml24
-rw-r--r--examples/declarative/particles/imageparticle/deformation.qml17
-rw-r--r--examples/declarative/particles/imageparticle/rotation.qml11
-rw-r--r--examples/declarative/particles/imageparticle/sprites.qml139
4 files changed, 51 insertions, 140 deletions
diff --git a/examples/declarative/particles/imageparticle/allatonce.qml b/examples/declarative/particles/imageparticle/allatonce.qml
index 0d5a11f386..797a835bbd 100644
--- a/examples/declarative/particles/imageparticle/allatonce.qml
+++ b/examples/declarative/particles/imageparticle/allatonce.qml
@@ -52,23 +52,9 @@ Rectangle {
ImageParticle {
sprites: [
Sprite {
- name: "licking"
- source: "../images/squarefacewhite.png"
- frames: 6
- duration: 120
- to: {"dying":1, "licking":5}
- },
- Sprite {
- name: "dying"
- source: "../images/squarefacewhiteX.png"
- frames: 4
- duration: 120
- to: {"dead":1}
- },
- Sprite {
- name: "dead"
- source: "../images/squarefacewhiteXX.png"
- frames: 1
+ name: "bear"
+ source: "../images/bear_tiles.png"
+ frames: 13
duration: 120
}
]
@@ -90,8 +76,8 @@ Rectangle {
emitRate: 200
lifeSpan: 6000
speed: AngleDirection {angleVariation: 360; magnitude: 80; magnitudeVariation: 40}
- size: 40
- endSize: 80
+ size: 60
+ endSize: 120
}
Text {
diff --git a/examples/declarative/particles/imageparticle/deformation.qml b/examples/declarative/particles/imageparticle/deformation.qml
index 989a699395..5bd9f74c89 100644
--- a/examples/declarative/particles/imageparticle/deformation.qml
+++ b/examples/declarative/particles/imageparticle/deformation.qml
@@ -50,7 +50,7 @@ Rectangle {
ImageParticle {
system: sys
groups: ["goingLeft", "goingRight"]
- source: "../images/singlesmile.png"
+ source: "../images/starfish_4.png"
rotation: 90
rotationSpeed: 90
autoRotation: true
@@ -58,7 +58,8 @@ Rectangle {
ImageParticle {
system: sys
groups: ["goingDown"]
- source: "../images/squarefacespriteXX.png"
+ source: "../images/starfish_0.png"
+ rotation: 180
yVector: PointDirection { y: 0.5; yVariation: 0.25; xVariation: 0.25; }
}
@@ -90,8 +91,8 @@ Rectangle {
group: "goingRight"
speed: PointDirection { x: 100 }
lifeSpan: 4000
- emitRate: 2
- size: 32
+ emitRate: 1
+ size: 128
}
Emitter {
id: emitB
@@ -102,8 +103,8 @@ Rectangle {
group: "goingLeft"
speed: PointDirection { x: -100 }
lifeSpan: 4000
- emitRate: 2
- size: 32
+ emitRate: 1
+ size: 128
}
Emitter {
id: emitC
@@ -114,7 +115,7 @@ Rectangle {
group: "goingDown"
speed: PointDirection { x: 100 }
lifeSpan: 4000
- emitRate: 2
- size: 32
+ emitRate: 1
+ size: 128
}
}
diff --git a/examples/declarative/particles/imageparticle/rotation.qml b/examples/declarative/particles/imageparticle/rotation.qml
index fe77e43f73..d5a6e8d315 100644
--- a/examples/declarative/particles/imageparticle/rotation.qml
+++ b/examples/declarative/particles/imageparticle/rotation.qml
@@ -49,20 +49,23 @@ Rectangle {
ImageParticle {
id: up
system: sys
- source: "../images/smile.png"
+ source: "../images/starfish_2.png"
}
Emitter {
anchors.centerIn: parent
system: sys
- emitRate: 1000
- size: 20
+ emitRate: 10
+ size: 200
lifeSpan: 10000
speed: AngleDirection {angleVariation: 360; magnitudeVariation: 100;}
}
MouseArea {
anchors.fill: parent
- onClicked: up.autoRotation = !up.autoRotation
+ onClicked: {
+ up.autoRotation = !up.autoRotation
+ up.rotation = up.autoRotation ? -90 : 0
+ }
}
}
diff --git a/examples/declarative/particles/imageparticle/sprites.qml b/examples/declarative/particles/imageparticle/sprites.qml
index ad18c48640..dfc4447e45 100644
--- a/examples/declarative/particles/imageparticle/sprites.qml
+++ b/examples/declarative/particles/imageparticle/sprites.qml
@@ -42,69 +42,20 @@ import QtQuick 2.0
import QtQuick.Particles 2.0
Rectangle {
- color: "goldenrod"
+ color: "lightsteelblue"
width: 800
height: 800
id: root
SpriteImage {
- sprites: [Sprite {
- name: "happy"
- source: "../images/squarefacesprite2.png"
- frames: 6
- duration: 120
- to: {"silly": 0.4, "sad": 0.2, "cyclops":0.1, "boggled":0.3, "dying":0.0}
- }, Sprite {
- name: "silly"
- source: "../images/squarefacesprite.png"
- frames: 6
- duration: 120
- to: {"love": 0.4, "happy": 0.1, "evil": 0.2, "cyclops":0.1, "boggled":0.2}
- }, Sprite {
- name: "sad"
- source: "../images/squarefacesprite3.png"
- frames: 6
- duration: 120
- to: {"love" : 0.2, "evil": 0.2, "silly": 0.2, "cyclops":0.2, "boggled":0.2}
- }, Sprite {
- name: "cyclops"
- source: "../images/squarefacesprite4.png"
- frames: 6
- duration: 120
- to: {"love": 0.1, "evil": 0.1, "silly":0.1, "boggled":0.1, "cyclops" : 1.0}
- }, Sprite {
- name: "evil"
- source: "../images/squarefacesprite5.png"
- frames: 6
- duration: 120
- to: {"happy": 1.0}
- }, Sprite {
- name: "love"
- source: "../images/squarefacesprite6.png"
- frames: 6
- duration: 120
- to: {"sad": 0.6, "evil":0.4, "boggled":0.2}
- }, Sprite {
- name: "boggled"
- source: "../images/squarefacesprite7.png"
- frames: 6
- duration: 120
- to: {"love" : 0.2, "evil": 0.2, "silly": 0.2, "cyclops":0.1, "sad":0.2}
- }, Sprite {
- name: "dying"
- source: "../images/squarefacespriteX.png"
- frames: 4
- duration: 120
- to: {"dead":1.0}
- }, Sprite {
- name: "dead"
- source: "../images/squarefacespriteXX.png"
- frames: 1
- duration: 10000
- }]
-
- width: 100
- height: 100
+ sprites: Sprite {
+ name: "bear"
+ source: "../images/bear_tiles.png"
+ frames: 13
+ duration: 120
+ }
+ width: 250
+ height: 250
x: 20
y: 20
z:4
@@ -118,68 +69,38 @@ Rectangle {
system: sys
sprites: [Sprite {
name: "happy"
- source: "../images/squarefacesprite2.png"
- frames: 6
- duration: 120
- to: {"silly": 0.4, "sad": 0.2, "cyclops":0.1, "boggled":0.3, "dying":0.0}
- }, Sprite {
- name: "silly"
- source: "../images/squarefacesprite.png"
- frames: 6
- duration: 120
- to: {"love": 0.4, "happy": 0.1, "evil": 0.2, "cyclops":0.1, "boggled":0.2}
- }, Sprite {
- name: "sad"
- source: "../images/squarefacesprite3.png"
- frames: 6
- duration: 120
- to: {"love" : 0.2, "evil": 0.2, "silly": 0.2, "cyclops":0.2, "boggled":0.2}
- }, Sprite {
- name: "cyclops"
- source: "../images/squarefacesprite4.png"
- frames: 6
- duration: 120
- to: {"love": 0.1, "evil": 0.1, "silly":0.1, "boggled":0.1, "cyclops" : 1.0}
- }, Sprite {
- name: "evil"
- source: "../images/squarefacesprite5.png"
- frames: 6
- duration: 120
- to: {"happy": 1.0}
- }, Sprite {
- name: "love"
- source: "../images/squarefacesprite6.png"
- frames: 6
- duration: 120
- to: {"sad": 0.6, "evil":0.4, "boggled":0.2}
+ source: "../images/starfish_1.png"
+ frames: 1
+ duration: 260
+ to: {"happy": 1, "silly": 1, "angry": 1}
}, Sprite {
- name: "boggled"
- source: "../images/squarefacesprite7.png"
- frames: 6
- duration: 120
- to: {"love" : 0.2, "evil": 0.2, "silly": 0.2, "cyclops":0.1, "sad":0.2}
+ name: "angry"
+ source: "../images/starfish_0.png"
+ frames: 1
+ duration: 260
+ to: {"happy": 1, "silly": 1, "angry": 1}
}, Sprite {
- name: "dying"
- source: "../images/squarefacespriteX.png"
- frames: 4
- duration: 120
- to: {"dead":1.0}
+ name: "silly"
+ source: "../images/starfish_2.png"
+ frames: 1
+ duration: 260
+ to: {"happy": 1, "silly": 1, "noticedbear": 0}
}, Sprite {
- name: "dead"
- source: "../images/squarefacespriteXX.png"
+ name: "noticedbear"
+ source: "../images/starfish_3.png"
frames: 1
- duration: 10000
+ duration: 2600
}]
}
Emitter {
system: sys
- emitRate: 16
+ emitRate: 2
lifeSpan: 10000
speed: AngleDirection {angle: 90; magnitude: 60; angleVariation: 5}
acceleration: PointDirection { y: 10 }
- size: 30
- sizeVariation: 10
+ size: 160
+ sizeVariation: 40
width: parent.width
height: 100
}
@@ -189,6 +110,6 @@ Rectangle {
width: root.width;
height: root.height/2;
y: root.height/2;
- goalState:"dead"
+ goalState:"noticedbear"
}
}