aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-06-08 13:19:56 +1000
committerAlan Alpert <alan.alpert@nokia.com>2011-06-08 13:28:21 +1000
commit1f88f2ceedf00f96e2491ecdd1c655b0f12f3632 (patch)
tree1900da1a3793da99f9601762d337cf82dc4701ce
parent984f21f18d1a3981e7363df467ff2e24e69aa847 (diff)
Immense Particles Refactor Part C
Demos work again (also, the examples I missed). Added an example launcher for particles.
-rw-r--r--demos/declarative/flickr/content/ImageDetails.qml182
-rw-r--r--demos/declarative/flickr/content/Progress.qml8
-rw-r--r--demos/declarative/flickr/content/StreamView.qml16
-rw-r--r--demos/declarative/flickr/content/UnifiedDelegate.qml2
-rw-r--r--demos/declarative/flickr/content/images/noise.pngbin0 -> 92003 bytes
-rw-r--r--demos/declarative/flickr/flickr.qml10
-rw-r--r--demos/declarative/minehunt/MinehuntCore/Explosion.qml2
-rw-r--r--demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml2
-rw-r--r--demos/declarative/plasmapatrol/content/BlasterHardpoint.qml12
-rw-r--r--demos/declarative/plasmapatrol/content/CannonHardpoint.qml8
-rw-r--r--demos/declarative/plasmapatrol/content/ChoiceBox.qml2
-rw-r--r--demos/declarative/plasmapatrol/content/Cruiser.qml12
-rw-r--r--demos/declarative/plasmapatrol/content/Frigate.qml8
-rw-r--r--demos/declarative/plasmapatrol/content/Hardpoint.qml2
-rw-r--r--demos/declarative/plasmapatrol/content/HelpScreens.qml2
-rw-r--r--demos/declarative/plasmapatrol/content/LaserHardpoint.qml14
-rw-r--r--demos/declarative/plasmapatrol/content/PlasmaPatrolParticles.qml24
-rw-r--r--demos/declarative/plasmapatrol/content/Ship.qml2
-rw-r--r--demos/declarative/plasmapatrol/content/Sloop.qml8
-rw-r--r--demos/declarative/plasmapatrol/plasmapatrol.qml8
-rw-r--r--demos/declarative/samegame/SamegameCore/BoomBlock.qml10
-rw-r--r--demos/declarative/samegame/samegame.qml8
-rw-r--r--demos/declarative/snake/content/Cookie.qml2
-rw-r--r--demos/declarative/snake/content/Link.qml2
-rw-r--r--examples/declarative/particles/asteroid/blackhole.qml5
-rw-r--r--examples/declarative/particles/exampleslauncher.qml182
-rw-r--r--examples/declarative/particles/launcherContent/Button.qml (renamed from examples/declarative/particles/snow/content/Button.qml)0
-rw-r--r--examples/declarative/particles/launcherContent/Shell.qml78
-rw-r--r--examples/declarative/particles/launcherContent/icons/asteroid.pngbin0 -> 35579 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/blackhole.pngbin0 -> 31296 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/blurparticles.pngbin0 -> 7793 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/close.pngbin0 -> 2144 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/dynamicemitters.pngbin0 -> 9347 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/fireballs.pngbin0 -> 5371 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/flickr.pngbin0 -> 10542 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/gridsplosion.pngbin0 -> 8154 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/layered.pngbin0 -> 8572 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/list.pngbin0 -> 32912 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/overburst.pngbin0 -> 1019 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/package.pngbin0 -> 3163 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/plain.pngbin0 -> 4705 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/plasmapatrol.pngbin0 -> 9839 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/portal.pngbin0 -> 11359 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/rainbow.pngbin0 -> 6538 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/remove.pngbin0 -> 2144 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/samegame.pngbin0 -> 8647 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/shimmer.pngbin0 -> 13670 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/smile.pngbin0 -> 12784 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/smilefactory.pngbin0 -> 2863 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/snow.pngbin0 -> 5858 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/spaceexplorer.pngbin0 -> 9152 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/spriteparticles.pngbin0 -> 6963 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/spritestateparticles.pngbin0 -> 2565 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/spritevariedparticles.pngbin0 -> 2569 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/stream.pngbin0 -> 26560 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/trails.pngbin0 -> 23168 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/turbulence.pngbin0 -> 9684 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/ultraparticles.pngbin0 -> 9590 bytes
-rw-r--r--examples/declarative/particles/launcherContent/icons/velocityfrommotion.pngbin0 -> 36360 bytes
-rw-r--r--examples/declarative/particles/launcherContent/launcher.js8
-rw-r--r--examples/declarative/particles/snow/snow.qml7
61 files changed, 489 insertions, 137 deletions
diff --git a/demos/declarative/flickr/content/ImageDetails.qml b/demos/declarative/flickr/content/ImageDetails.qml
index 62c3397f08..46827ae3bb 100644
--- a/demos/declarative/flickr/content/ImageDetails.qml
+++ b/demos/declarative/flickr/content/ImageDetails.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Flipable {
id: container
@@ -57,6 +57,8 @@ Flipable {
property int rating: 2
property variant prevScale: 1.0
+ property int flipDuration: 1600
+
signal closed
transform: Rotation {
@@ -137,94 +139,172 @@ Flipable {
slider.value = prevScale;
}
if (inBackState && bigImage.status == Image.Ready)
- particleBox.imageInAnim();
+ effectBox.imageInAnim();
}
property bool inBackState: false
onInBackStateChanged:{
if(inBackState && bigImage.status == Image.Ready)
- particleBox.imageInAnim();
+ effectBox.imageInAnim();
else if (!inBackState && bigImage.status == Image.Ready)
- particleBox.imageOutAnim();
+ effectBox.imageOutAnim();
}
}
+ ShaderEffectSource{
+ id: pictureSource
+ sourceItem: bigImage
+ smooth: true
+ //Workaround: Doesn't work below lines
+ width: bigImage.width
+ height: bigImage.width
+ visible: false
+ }
+ Turbulence{//only fill visible rect
+ id: turbulence
+ system: imageSystem
+ anchors.fill: parent
+ frequency: 100
+ strength: 250
+ active: false
+ }
Item{
- id: particleBox
+ id: effectBox
width: bigImage.width * bigImage.scale
height: bigImage.height * bigImage.scale
anchors.centerIn: parent
-
function imageInAnim(){
- cp.visible = true;
- pixAffect.onceOff = false;
bigImage.visible = false;
+ noiseIn.visible = true;
endEffectTimer.start();
- pixelEmitter.pulse(1);
}
function imageOutAnim(){
- cp.visible = true;
- pixAffect.onceOff = true;
bigImage.visible = false;
+ noiseIn.visible = false;
turbulence.active = true;
endEffectTimer.start();
pixelEmitter.burst(2048);
}
Timer{
id: endEffectTimer
- interval: 1000
+ interval: flipDuration
repeat: false
running: false
onTriggered:{
- bigImage.visible = true;
turbulence.active = false;
- cp.visible = false;
+ noiseIn.visible = false;
+ bigImage.visible = true;
}
}
- ParticleSystem{
- id: imageSystem
- }
- ColoredParticle{
- id: cp
- system: imageSystem
- color: "gray"
- alpha: 1
- image: "images/squareParticle.png"
- colorVariation: 0
- }
- Picture{
- id: pixAffect
- system: imageSystem
+ ShaderEffectItem{
+ id: noiseIn
anchors.fill: parent
- image: container.photoUrl;
- onceOff: true
- }
- Turbulence{
- id: turbulence
- system: imageSystem
- anchors.fill: parent
- frequency: 100
- strength: 250
- active: false
+ property real t: 0
+ visible: false
+ onVisibleChanged: tAnim.start()
+ NumberAnimation{
+ id: tAnim
+ target: noiseIn
+ property: "t"
+ from: 0.0
+ to: 1.0
+ duration: flipDuration
+ }
+ property variant source: pictureSource
+ property variant noise: ShaderEffectSource{
+ sourceItem:Image{
+ source: "images/noise.png"
+ }
+ hideSource: true
+ smooth: false
+ }
+ fragmentShader:"
+ uniform sampler2D noise;
+ uniform sampler2D source;
+ uniform highp float t;
+ uniform lowp float qt_Opacity;
+ varying highp vec2 qt_TexCoord0;
+ void main(){
+ //Want to use noise2, but it always returns (0,0)?
+ if(texture2D(noise, qt_TexCoord0).w <= t)
+ gl_FragColor = texture2D(source, qt_TexCoord0) * qt_Opacity;
+ else
+ gl_FragColor = vec4(0.,0.,0.,0.);
+ }
+ "
}
- TrailEmitter{
- id: pixelEmitter0
- system: imageSystem
- height: parent.height
- particleSize: 4
- particleDuration: 1000
- particlesPerSecond: 4096
- speed: PointVector{x: 360; xVariation: 8; yVariation: 4}
- emitting: false
+ ParticleSystem{
+ id: imageSystem
}
- TrailEmitter{
+ Emitter{
id: pixelEmitter
system: imageSystem
- anchors.fill: parent
+ //anchors.fill: parent
+ width: Math.min(bigImage.width * bigImage.scale, flickable.width);
+ height: Math.min(bigImage.height * bigImage.scale, flickable.height);
+ anchors.centerIn: parent
particleSize: 4
- particleDuration: 1000
+ particleDuration: flipDuration
particlesPerSecond: 2048
emitting: false
}
+ CustomParticle{
+ id: blowOut
+ system: imageSystem
+ property real maxWidth: effectBox.width
+ property real maxHeight: effectBox.height
+ vertexShader:"
+ attribute highp vec2 vPos;
+ attribute highp vec2 vTex;
+ attribute highp vec4 vData; // x = time, y = lifeSpan, z = size, w = endSize
+ attribute highp vec4 vVec; // x,y = constant speed, z,w = acceleration
+ attribute highp float r;
+
+ uniform highp float maxWidth;
+ uniform highp float maxHeight;
+
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ uniform highp float timestamp;
+ uniform lowp float qt_Opacity;
+
+ varying highp vec2 fTex2;
+ varying lowp float fFade;
+
+ void main() {
+ fTex2 = vec2(vPos.x / maxWidth, vPos.y / maxHeight);
+ highp float size = vData.z;
+ highp float endSize = vData.w;
+
+ highp float t = (timestamp - vData.x) / vData.y;
+
+ highp float currentSize = mix(size, endSize, t * t);
+
+ if (t < 0. || t > 1.)
+ currentSize = 0.;
+
+ highp vec2 pos = vPos
+ - currentSize / 2. + currentSize * vTex // adjust size
+ + vVec.xy * t * vData.y // apply speed vector..
+ + 0.5 * vVec.zw * pow(t * vData.y, 2.);
+
+ gl_Position = qt_ModelViewProjectionMatrix * vec4(pos.x, pos.y, 0, 1);
+
+ highp float fadeIn = min(t * 10., 1.);
+ highp float fadeOut = 1. - max(0., min((t - 0.75) * 4., 1.));
+
+ fFade = 1.0;//fadeIn * fadeOut * qt_Opacity;
+ }
+ "
+ property variant pictureTexture: pictureSource
+ fragmentShader: "
+ uniform sampler2D pictureTexture;
+ varying highp vec2 fTex2;
+ varying highp float fFade;
+ void main() {
+ gl_FragColor = texture2D(pictureTexture, fTex2) * fFade;
+ }"
+ }
+
+
}
}
@@ -268,7 +348,7 @@ Flipable {
transitions: Transition {
SequentialAnimation {
PropertyAction { target: bigImage; property: "smooth"; value: false }
- NumberAnimation { easing.type: Easing.InOutQuad; properties: "angle"; duration: 1000 }
+ NumberAnimation { easing.type: Easing.InOutQuad; properties: "angle"; duration: flipDuration }
PropertyAction { target: bigImage; property: "smooth"; value: !flickable.movingVertically }
}
}
diff --git a/demos/declarative/flickr/content/Progress.qml b/demos/declarative/flickr/content/Progress.qml
index d403feebd1..30142b4e29 100644
--- a/demos/declarative/flickr/content/Progress.qml
+++ b/demos/declarative/flickr/content/Progress.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item{
id: container
@@ -59,17 +59,17 @@ Item{
running: container.visible
id: barSys
}
- ColoredParticle{
+ ImageParticle{
color: "lightsteelblue"
alpha: 0.1
colorVariation: 0.05
image: "images/particle.png"
system: barSys
}
- TrailEmitter{
+ Emitter{
y: 2; height: parent.height-4;
x: 2; width: Math.max(parent.width * progress - 4, 0);
- speed: AngleVector{ angleVariation: 180; magnitudeVariation: 12 }
+ speed: AngledDirection{ angleVariation: 180; magnitudeVariation: 12 }
system: barSys
particlesPerSecond: width;
particleDuration: 1000
diff --git a/demos/declarative/flickr/content/StreamView.qml b/demos/declarative/flickr/content/StreamView.qml
index 26a3f35e63..22e7d5dcd2 100644
--- a/demos/declarative/flickr/content/StreamView.qml
+++ b/demos/declarative/flickr/content/StreamView.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item{
id: container
@@ -52,7 +52,7 @@ Item{
anchors.fill:parent
overwrite: false
}
- DataParticle{
+ ModelParticle{
id: mp
fade: false
system: sys
@@ -66,35 +66,35 @@ Item{
}
}
property real emitterSpacing: parent.width/3
- TrailEmitter{
+ Emitter{
system: sys
width: emitterSpacing - 64
x: emitterSpacing*0 + 32
y: -128
height: 32
- speed: PointVector{ y: (container.height + 128)/12 }
+ speed: PointDirection{ y: (container.height + 128)/12 }
particlesPerSecond: 0.4
particleDuration: 1000000//eventually -1 should mean a million seconds for neatness
maxParticles: 15
}
- TrailEmitter{
+ Emitter{
system: sys
width: emitterSpacing - 64
x: emitterSpacing*1 + 32
y: -128
height: 32
- speed: PointVector{ y: (container.height + 128)/12 }
+ speed: PointDirection{ y: (container.height + 128)/12 }
particlesPerSecond: 0.4
particleDuration: 1000000//eventually -1 should mean a million seconds for neatness
maxParticles: 15
}
- TrailEmitter{
+ Emitter{
system: sys
width: emitterSpacing - 64
x: emitterSpacing*2 + 32
y: -128
height: 32
- speed: PointVector{ y: (container.height + 128)/12 }
+ speed: PointDirection{ y: (container.height + 128)/12 }
particlesPerSecond: 0.4
particleDuration: 1000000//eventually -1 should mean a million seconds for neatness
maxParticles: 15
diff --git a/demos/declarative/flickr/content/UnifiedDelegate.qml b/demos/declarative/flickr/content/UnifiedDelegate.qml
index aaf4ccbd7a..f4c926763f 100644
--- a/demos/declarative/flickr/content/UnifiedDelegate.qml
+++ b/demos/declarative/flickr/content/UnifiedDelegate.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Package {
function photoClicked() {
diff --git a/demos/declarative/flickr/content/images/noise.png b/demos/declarative/flickr/content/images/noise.png
new file mode 100644
index 0000000000..abc3c18d5f
--- /dev/null
+++ b/demos/declarative/flickr/content/images/noise.png
Binary files differ
diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml
index 8543692998..b7ab19d791 100644
--- a/demos/declarative/flickr/flickr.qml
+++ b/demos/declarative/flickr/flickr.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
import "content"
Item {
@@ -56,7 +56,7 @@ Item {
id: bgParticles
startTime: 16000
}
- ColoredParticle {
+ ImageParticle {
particles: ["trail"]
image: "content/images/particle.png"
color: "#1A1A6F"
@@ -65,12 +65,12 @@ Item {
blueVariation: 0.8
system: bgParticles
}
- TrailEmitter {
+ Emitter {
particle: "drops"
width: parent.width
particlesPerSecond: 0.5
particleDuration: 20000
- speed: PointVector{
+ speed: PointDirection{
y: {screen.height/18}
}
system: bgParticles
@@ -87,7 +87,7 @@ Item {
anchors.fill: parent
emissionWidth: 16
emissionHeight: 16
- emissionShape: Ellipse{}
+ emissionShape: EllipseShape{}
}
VisualDataModel{
diff --git a/demos/declarative/minehunt/MinehuntCore/Explosion.qml b/demos/declarative/minehunt/MinehuntCore/Explosion.qml
index 33eabf033c..668d7b1a19 100644
--- a/demos/declarative/minehunt/MinehuntCore/Explosion.qml
+++ b/demos/declarative/minehunt/MinehuntCore/Explosion.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 1.0
-import Qt.labs.particles 1.0
+import QtQuick.Particles 1.0
Item {
property bool explode : false
diff --git a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
index 9fcd68b1ff..c6b3e1b577 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml
@@ -85,7 +85,7 @@ Component {
anchors.centerIn: parent; anchors.verticalCenterOffset: -30
path: Path {
PathAttribute { name: 'z'; value: 9999.0 }
- PathLine { x: 1; y: 1 }
+ PathLineShape { x: 1; y: 1 }
PathAttribute { name: 'z'; value: 0.0 }
}
}
diff --git a/demos/declarative/plasmapatrol/content/BlasterHardpoint.qml b/demos/declarative/plasmapatrol/content/BlasterHardpoint.qml
index 8d36cdfb13..fb30cd008b 100644
--- a/demos/declarative/plasmapatrol/content/BlasterHardpoint.qml
+++ b/demos/declarative/plasmapatrol/content/BlasterHardpoint.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item {
id: container
@@ -53,14 +53,14 @@ Item {
width: 24
height: 24
- TrailEmitter{
+ Emitter{
id: visualization
particle: "blaster"
system: container.system
emitting: show
anchors.fill: parent
- shape: Ellipse{}
- speed: DirectedVector{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true}
+ shape: EllipseShape{}
+ speed: TargetedDirection{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true}
particleDuration: 1000
particlesPerSecond: 64
@@ -112,7 +112,7 @@ Item {
rofTimer.repeat = false;
}
}
- TrailEmitter{
+ Emitter{
id: emitter
particle: "blaster"
emitting: false
@@ -125,7 +125,7 @@ Item {
particleSize: 24
particleEndSize:16
particleSizeVariation: 8
- speed: DirectedVector{
+ speed: TargetedDirection{
id: blastVector
targetX: target.x; targetY: target.y; magnitude: 1.1; proportionalMagnitude: true
}
diff --git a/demos/declarative/plasmapatrol/content/CannonHardpoint.qml b/demos/declarative/plasmapatrol/content/CannonHardpoint.qml
index d9a307cc64..fd49e4dd6d 100644
--- a/demos/declarative/plasmapatrol/content/CannonHardpoint.qml
+++ b/demos/declarative/plasmapatrol/content/CannonHardpoint.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item {
id: container
@@ -49,7 +49,7 @@ Item {
width: 24
height: 24
- TrailEmitter{
+ Emitter{
id: visualization
particle: "cannon"
emitting: container.show
@@ -78,7 +78,7 @@ Item {
}
emitter.burst(1);
}
- TrailEmitter{
+ Emitter{
id: emitter
particle: "cannon"
emitting: false
@@ -89,7 +89,7 @@ Item {
particlesPerSecond: 1
particleSize: 8
particleEndSize: 4
- speed: DirectedVector{
+ speed: TargetedDirection{
id: blastVector
targetX: target.x; targetY: target.y; magnitude: 1.1; proportionalMagnitude: true
}
diff --git a/demos/declarative/plasmapatrol/content/ChoiceBox.qml b/demos/declarative/plasmapatrol/content/ChoiceBox.qml
index 6bdc4288ee..1e64a76225 100644
--- a/demos/declarative/plasmapatrol/content/ChoiceBox.qml
+++ b/demos/declarative/plasmapatrol/content/ChoiceBox.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item{
id: container
diff --git a/demos/declarative/plasmapatrol/content/Cruiser.qml b/demos/declarative/plasmapatrol/content/Cruiser.qml
index 8b8073328e..71af0abffa 100644
--- a/demos/declarative/plasmapatrol/content/Cruiser.qml
+++ b/demos/declarative/plasmapatrol/content/Cruiser.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item {
id: container
@@ -54,7 +54,7 @@ Item {
property int gunType: 0
width: 128
height: 128
- TrailEmitter{
+ Emitter{
//TODO: Cooler would be an 'orbiting' affector
//TODO: On the subject, opacity and size should be grouped type 'overLife' if we can cram that in the particles
system: container.system
@@ -62,7 +62,7 @@ Item {
anchors.centerIn: parent
width: 64
height: 64
- shape: Ellipse{}
+ shape: EllipseShape{}
particlesPerSecond: hp > 0 ? hp * 1 + 20 : 0
particleDuration: 2400
@@ -72,13 +72,13 @@ Item {
particleSizeVariation: 16
particleEndSize: 16
- speed: AngleVector{angleVariation:360; magnitudeVariation: 32}
+ speed: AngledDirection{angleVariation:360; magnitudeVariation: 32}
}
- TrailEmitter{
+ Emitter{
system: container.system
particle: "cruiserArmor"
anchors.fill: parent
- shape: Ellipse{ fill: false }
+ shape: EllipseShape{ fill: false }
emitting: hp>0
particlesPerSecond: 16
diff --git a/demos/declarative/plasmapatrol/content/Frigate.qml b/demos/declarative/plasmapatrol/content/Frigate.qml
index 54f629268f..f18de0154a 100644
--- a/demos/declarative/plasmapatrol/content/Frigate.qml
+++ b/demos/declarative/plasmapatrol/content/Frigate.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item {
id: container
@@ -54,7 +54,7 @@ Item {
property int gunType: 0
width: 128
height: 128
- TrailEmitter{
+ Emitter{
system: container.system
particle: "frigateShield"
anchors.centerIn: parent
@@ -63,13 +63,13 @@ Item {
particleDuration: 4800
emitting: hp > 0
}
- TrailEmitter{
+ Emitter{
system: container.system
particle: container.shipParticle
anchors.centerIn: parent
width: 64
height: 16
- shape: Ellipse{}
+ shape: EllipseShape{}
particleSize: 16
particleSizeVariation: 8
diff --git a/demos/declarative/plasmapatrol/content/Hardpoint.qml b/demos/declarative/plasmapatrol/content/Hardpoint.qml
index 184c750a79..3d4edb38f8 100644
--- a/demos/declarative/plasmapatrol/content/Hardpoint.qml
+++ b/demos/declarative/plasmapatrol/content/Hardpoint.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item {
id: container
diff --git a/demos/declarative/plasmapatrol/content/HelpScreens.qml b/demos/declarative/plasmapatrol/content/HelpScreens.qml
index 8896aeee4a..7e4fb9f1c9 100644
--- a/demos/declarative/plasmapatrol/content/HelpScreens.qml
+++ b/demos/declarative/plasmapatrol/content/HelpScreens.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
SequentialLoader {
id: hLdr
diff --git a/demos/declarative/plasmapatrol/content/LaserHardpoint.qml b/demos/declarative/plasmapatrol/content/LaserHardpoint.qml
index d6d470a15b..3705d29287 100644
--- a/demos/declarative/plasmapatrol/content/LaserHardpoint.qml
+++ b/demos/declarative/plasmapatrol/content/LaserHardpoint.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item {
id: container
@@ -49,14 +49,14 @@ Item {
width: 24
height: 24
- TrailEmitter{
+ Emitter{
id: visualization
particle: "laser"
system: container.system
anchors.fill: parent
emitting: container.show
- shape: Ellipse{}
- speed: DirectedVector{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true }
+ shape: EllipseShape{}
+ speed: TargetedDirection{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true }
particleDuration: 1000
particlesPerSecond: 64
@@ -84,7 +84,7 @@ Item {
emitter.pulse(0.10);
// console.log("Fire box: " + Math.min(container.width/2, target.x) + "," + Math.min(container.height/2, target.y) + " " + (Math.max(container.width/2, target.x) - Math.min(container.width/2, target.x)) + "," + (Math.max(container.height/2, target.y) - Math.min(container.height/2, target.y)));
}
- TrailEmitter{
+ Emitter{
id: emitter
particle: "laser"
emitting: false
@@ -93,7 +93,7 @@ Item {
width: Math.max(container.width/2, target.x) - x;
y: Math.min(container.height/2, target.y);
height: Math.max(container.height/2, target.y) - y;
- shape: Line{
+ shape: LineShape{
mirrored: (emitter.y < 0 || emitter.x < 0) && !(emitter.y < 0 && emitter.x < 0 )//I just want XOR
}
@@ -103,6 +103,6 @@ Item {
particleSize: 16
particleEndSize: 0
- speed: PointVector{xVariation: 4; yVariation: 4}
+ speed: PointDirection{xVariation: 4; yVariation: 4}
}
}
diff --git a/demos/declarative/plasmapatrol/content/PlasmaPatrolParticles.qml b/demos/declarative/plasmapatrol/content/PlasmaPatrolParticles.qml
index 7a6fcb96d0..26d5f21359 100644
--- a/demos/declarative/plasmapatrol/content/PlasmaPatrolParticles.qml
+++ b/demos/declarative/plasmapatrol/content/PlasmaPatrolParticles.qml
@@ -39,11 +39,11 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item{
property ParticleSystem sys
- ColoredParticle{
+ ImageParticle{
system: sys
particles: ["default"]
image: "pics/blur-circle3.png"
@@ -51,7 +51,7 @@ Item{
colorVariation: 0.1
z: 0
}
- ColoredParticle{
+ ImageParticle{
system: sys
particles: ["redTeam"]
image: "pics/blur-circle3.png"
@@ -59,7 +59,7 @@ Item{
colorVariation: 0.1
z: 0
}
- ColoredParticle{
+ ImageParticle{
system: sys
particles: ["greenTeam"]
image: "pics/blur-circle3.png"
@@ -67,7 +67,7 @@ Item{
colorVariation: 0.1
z: 0
}
- ColoredParticle{
+ ImageParticle{
system: sys
particles: ["blaster"]
image: "pics/star2.png"
@@ -76,7 +76,7 @@ Item{
colorVariation: 0.2
z: 2
}
- ColoredParticle{
+ ImageParticle{
system: sys
particles: ["laser"]
image: "pics/star3.png"
@@ -85,7 +85,7 @@ Item{
colorVariation: 0.2
z: 2
}
- ColoredParticle{
+ ImageParticle{
system: sys
particles: ["cannon"]
image: "pics/particle.png"
@@ -93,7 +93,7 @@ Item{
colorVariation: 0.1
z: 2
}
- ColoredParticle{
+ ImageParticle{
system: sys
particles: ["cannonCore"]
image: "pics/particle.png"
@@ -101,7 +101,7 @@ Item{
colorVariation: 0.8
z: 1
}
- ColoredParticle{
+ ImageParticle{
system: sys
particles: ["cannonWake"]
image: "pics/star.png"
@@ -109,7 +109,7 @@ Item{
colorVariation: 0.2
z: 1
}
- ColoredParticle{
+ ImageParticle{
system: sys
particles: ["frigateShield"]
image: "pics/blur-circle2.png"
@@ -119,7 +119,7 @@ Item{
greenVariation: 0.1
z: 3
}
- SpriteParticle{
+ ImageParticle{
system: sys
particles: ["cruiserArmor"]
z: 1
@@ -150,7 +150,7 @@ Item{
follow: "cannon"
particlesPerParticlePerSecond: 64
particleDuration: 600
- speed: AngleVector{ angleVariation: 360; magnitude: 48}
+ speed: AngledDirection{ angleVariation: 360; magnitude: 48}
particleSize: 16
particleEndSize: 8
particleSizeVariation: 2
diff --git a/demos/declarative/plasmapatrol/content/Ship.qml b/demos/declarative/plasmapatrol/content/Ship.qml
index 0ccea94221..ce8fb6073f 100644
--- a/demos/declarative/plasmapatrol/content/Ship.qml
+++ b/demos/declarative/plasmapatrol/content/Ship.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item {
id: me
diff --git a/demos/declarative/plasmapatrol/content/Sloop.qml b/demos/declarative/plasmapatrol/content/Sloop.qml
index 1b9bce7333..20b60c5621 100644
--- a/demos/declarative/plasmapatrol/content/Sloop.qml
+++ b/demos/declarative/plasmapatrol/content/Sloop.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item {
id: container
@@ -55,19 +55,19 @@ Item {
property int gunType: 0
width: 128
height: 128
- TrailEmitter{
+ Emitter{
id: emitter
//TODO: Cooler would be an 'orbiting' affector
//TODO: On the subject, opacity and size should be grouped type 'overLife' if we can cram that in the particles
system: container.system
particle: container.shipParticle
- shape: Ellipse{}
+ shape: EllipseShape{}
particlesPerSecond: hp > 0 ? hp + 20 : 0
particleDuration: blinkInterval
maxParticles: (maxHP + 20)
- acceleration: AngleVector{angleVariation: 360; magnitude: 8}
+ acceleration: AngledDirection{angleVariation: 360; magnitude: 8}
particleSize: 24
particleEndSize: 4
diff --git a/demos/declarative/plasmapatrol/plasmapatrol.qml b/demos/declarative/plasmapatrol/plasmapatrol.qml
index 3a7b217618..c490dfd322 100644
--- a/demos/declarative/plasmapatrol/plasmapatrol.qml
+++ b/demos/declarative/plasmapatrol/plasmapatrol.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
import "content"
Rectangle {
@@ -93,18 +93,18 @@ Rectangle {
id: title
width: root.width
height: 240
- TrailEmitter{
+ Emitter{
anchors.fill: parent
system: particles
emitting: true
particle: "default"
particlesPerSecond: 1200
particleDuration: 1200
- shape: Mask{source:"content/pics/TitleText.png"}
+ shape: MaskShape{source:"content/pics/TitleText.png"}
particleSize: 16
particleEndSize: 0
particleSizeVariation: 8
- speed: AngleVector{angleVariation:360; magnitudeVariation: 6}
+ speed: AngledDirection{angleVariation:360; magnitudeVariation: 6}
}
}
Button{
diff --git a/demos/declarative/samegame/SamegameCore/BoomBlock.qml b/demos/declarative/samegame/SamegameCore/BoomBlock.qml
index 3d11fb9df2..b234688f8e 100644
--- a/demos/declarative/samegame/SamegameCore/BoomBlock.qml
+++ b/demos/declarative/samegame/SamegameCore/BoomBlock.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
Item {
id: block
@@ -71,7 +71,7 @@ Item {
Behavior on opacity { NumberAnimation { duration: 200 } }
anchors.fill: parent
}
- TrailEmitter {
+ Emitter {
id: particles
system: particleSystem
particle: {
@@ -85,12 +85,12 @@ Item {
}
anchors.fill: parent
- speed: DirectedVector{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
- shape: Ellipse{fill:true}
+ speed: TargetedDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
+ shape: EllipseShape{fill:true}
emitting: false;
particleDuration: 700; particleDurationVariation: 100
particlesPerSecond: 1000
- maxParticles: 100 //only fires 0.1s bursts (still 2x old number, ColoredParticle wants less than 16000 max though)
+ maxParticles: 100 //only fires 0.1s bursts (still 2x old number, ImageParticle wants less than 16000 max though)
particleSize: 28
particleEndSize: 14
}
diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml
index 0defdeec3c..c547e1afa7 100644
--- a/demos/declarative/samegame/samegame.qml
+++ b/demos/declarative/samegame/samegame.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 2.0
-import Qt.labs.particles 2.0
+import QtQuick.Particles 2.0
import "SamegameCore"
import "SamegameCore/samegame.js" as Logic
@@ -77,7 +77,7 @@ Rectangle {
}
Item{
ParticleSystem{ id: particleSystem; }
- ColoredParticle {
+ ImageParticle {
system: particleSystem
particles: ["red"]
color: Qt.darker("red");//Actually want desaturated...
@@ -85,7 +85,7 @@ Rectangle {
colorVariation: 0.4
alpha: 0.1
}
- ColoredParticle {
+ ImageParticle {
system: particleSystem
particles: ["green"]
color: Qt.darker("green");//Actually want desaturated...
@@ -93,7 +93,7 @@ Rectangle {
colorVariation: 0.4
alpha: 0.1
}
- ColoredParticle {
+ ImageParticle {
system: particleSystem
particles: ["blue"]
color: Qt.darker("blue");//Actually want desaturated...
diff --git a/demos/declarative/snake/content/Cookie.qml b/demos/declarative/snake/content/Cookie.qml
index a076978999..6efed6a154 100644
--- a/demos/declarative/snake/content/Cookie.qml
+++ b/demos/declarative/snake/content/Cookie.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 1.0
-import Qt.labs.particles 1.0
+import QtQuick.Particles 1.0
Item {
id: root
diff --git a/demos/declarative/snake/content/Link.qml b/demos/declarative/snake/content/Link.qml
index 8c1f4866bb..4c58c4dd5c 100644
--- a/demos/declarative/snake/content/Link.qml
+++ b/demos/declarative/snake/content/Link.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 1.0
-import Qt.labs.particles 1.0
+import QtQuick.Particles 1.0
Item { id:link
property bool dying: false
diff --git a/examples/declarative/particles/asteroid/blackhole.qml b/examples/declarative/particles/asteroid/blackhole.qml
index f2c9d0a98d..1bc406b00c 100644
--- a/examples/declarative/particles/asteroid/blackhole.qml
+++ b/examples/declarative/particles/asteroid/blackhole.qml
@@ -98,6 +98,7 @@ Rectangle{
image: "content/star.png"
color: "white"
colorVariation: 0.1
+ alpha: 0
}
ImageParticle{
id: roids
@@ -144,9 +145,11 @@ Rectangle{
colorVariation: 0.2
}
- GravitationalSingularity{
+ PointAttractor{
id: gs; x: root.width/2; y: root.height/2; strength: 4000000;
system: particles
+ physics: PointAttractor.Acceleration
+ proportionalToDistance: PointAttractor.Quadratic
}
Kill{
system: particles
diff --git a/examples/declarative/particles/exampleslauncher.qml b/examples/declarative/particles/exampleslauncher.qml
new file mode 100644
index 0000000000..c08123cf44
--- /dev/null
+++ b/examples/declarative/particles/exampleslauncher.qml
@@ -0,0 +1,182 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+import "launcherContent/launcher.js" as Util
+import "launcherContent"
+
+Rectangle{
+ color: "black"
+ width: 360
+ height: 600
+ Shell{
+ z: 1
+ id: shell
+ anchors.fill: parent
+ }
+ property string emissionMode: "Falling"
+ onEmissionModeChanged: workaround.active = true
+ VisualDataModel{//TODO: Transitions between modes
+ id: vdm
+ model: [
+ "../spaceexplorer/spaceexplorer.qml",
+ "../snow/snow.qml",
+ "../asteroid/asteroid.qml",
+ "../asteroid/blackhole.qml",
+ "../custom/blurparticles.qml",
+ "../modelparticles/bubbles.qml",
+ "../modelparticles/gridsplosion.qml",
+ "../modelparticles/package.qml",
+ "../modelparticles/stream.qml",
+ "../allsmiles/plain.qml",
+ "../allsmiles/smile.qml",
+ "../allsmiles/smilefactory.qml",
+ "../allsmiles/ultraparticles.qml",
+ "../allsmiles/spriteparticles.qml",
+ "../allsmiles/spritestateparticles.qml",
+ "../allsmiles/spritevariedparticles.qml",
+ "../trails/velocityfrommotion.qml",
+ "../trails/fireballs.qml",
+ "../trails/list.qml",
+ "../trails/portal.qml",
+ "../trails/rainbow.qml",
+ "../trails/dynamicemitters.qml",
+ "../trails/overburst.qml",
+ "../trails/layered.qml",
+ "../trails/shimmer.qml",
+ "../trails/turbulence.qml",
+ "../../../../demos/declarative/samegame/samegame.qml",
+ "../../../../demos/declarative/plasmapatrol/plasmapatrol.qml",
+ "../../../../demos/declarative/flickr/flickr.qml"
+ ]
+ delegate: Rectangle{
+ color: "white"
+ width: 96
+ height: 96
+ Image{
+ width: 72
+ height: 72
+ anchors.centerIn: parent
+ source: Util.iconFromPath(modelData)
+ }
+ Text{
+ text: Util.nameFromPath(modelData)
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ font.pixelSize: 8
+ }
+ MouseArea{
+ anchors.fill: parent
+ onClicked: shell.setDemo(modelData)
+ }
+ }
+ }
+ GridView{
+ anchors.fill: parent
+ anchors.bottomMargin: 128
+ model: vdm
+ visible: emissionMode == "Grid"
+ opacity: visible?1:0
+ Behavior on opacity{NumberAnimation{}}
+ }
+ ParticleSystem{ id: sys }
+ ModelParticle{
+ system: sys
+ model: vdm
+ }
+ Kill{
+ //TODO: File bug?
+ id: workaround
+ system: sys
+ active: false
+ onActiveChanged: timer.start()
+ Timer{
+ id: timer
+ interval: 32
+ running: false
+ repeat: false
+ onTriggered: workaround.active = false
+ }
+ }
+ Emitter{
+ system: sys
+ emitting: emissionMode == "Falling"
+ width: parent.width
+ particlesPerSecond: 2
+ particleDuration: 6000
+ speed: PointDirection{y:100;}
+ }
+ Emitter{
+ system: sys
+ emitting: emissionMode == "Bursting"
+ anchors.centerIn: parent
+ particlesPerSecond: 2
+ particleDuration: 6000
+ speed: AngledDirection{magnitude: 60; angleVariation: 360}
+ }
+ Emitter{
+ system: sys
+ emitting: emissionMode == "Shimmering"
+ anchors.fill: parent
+ particlesPerSecond: 4
+ particleDuration: 4000
+ }
+ Row{
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ Button{
+ text:"Grid"
+ onClicked: emissionMode = "Grid";
+ }
+ Button{
+ text:"Fall"
+ onClicked: emissionMode = "Falling";
+ }
+ Button{
+ text:"Burst"
+ onClicked: emissionMode = "Bursting";
+ }
+ Button{
+ text:"Shimmer"
+ onClicked: emissionMode = "Shimmering";
+ }
+ }
+}
diff --git a/examples/declarative/particles/snow/content/Button.qml b/examples/declarative/particles/launcherContent/Button.qml
index a937b3bede..a937b3bede 100644
--- a/examples/declarative/particles/snow/content/Button.qml
+++ b/examples/declarative/particles/launcherContent/Button.qml
diff --git a/examples/declarative/particles/launcherContent/Shell.qml b/examples/declarative/particles/launcherContent/Shell.qml
new file mode 100644
index 0000000000..32b0cd624c
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/Shell.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Loader{
+ id: ldr
+ visible: false
+ focus: visible
+ onVisibleChanged: source = ""
+ opacity: visible?1:0
+ Behavior on opacity{NumberAnimation{}}
+
+ function setDemo(str){
+ visible = true;
+ source = str;
+ }
+ Image{//TODO: Augment with PARTICLES
+ z: 1
+ source: "icons/close.png"
+ MouseArea{
+ anchors.fill: parent
+ onClicked: ldr.visible = false;
+ }
+ }
+ Rectangle{
+ z: -1
+ anchors.fill: parent
+ color:"black"
+ Text{
+ color: "white"
+ anchors.centerIn: parent
+ text: ldr.Status == Loader.Error ? "Error :(" : "Loading..."
+ }
+ MouseArea{
+ id: graball
+ anchors.fill: parent
+ onClicked:;
+ }
+ }
+}
diff --git a/examples/declarative/particles/launcherContent/icons/asteroid.png b/examples/declarative/particles/launcherContent/icons/asteroid.png
new file mode 100644
index 0000000000..77480c6f09
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/asteroid.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/blackhole.png b/examples/declarative/particles/launcherContent/icons/blackhole.png
new file mode 100644
index 0000000000..4bd8040c3b
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/blackhole.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/blurparticles.png b/examples/declarative/particles/launcherContent/icons/blurparticles.png
new file mode 100644
index 0000000000..7a247ae46e
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/blurparticles.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/close.png b/examples/declarative/particles/launcherContent/icons/close.png
new file mode 100644
index 0000000000..c37714ee8f
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/close.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/dynamicemitters.png b/examples/declarative/particles/launcherContent/icons/dynamicemitters.png
new file mode 100644
index 0000000000..0cdef9d21e
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/dynamicemitters.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/fireballs.png b/examples/declarative/particles/launcherContent/icons/fireballs.png
new file mode 100644
index 0000000000..39acf8b40d
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/fireballs.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/flickr.png b/examples/declarative/particles/launcherContent/icons/flickr.png
new file mode 100644
index 0000000000..4de2650280
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/flickr.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/gridsplosion.png b/examples/declarative/particles/launcherContent/icons/gridsplosion.png
new file mode 100644
index 0000000000..ec75453df6
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/gridsplosion.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/layered.png b/examples/declarative/particles/launcherContent/icons/layered.png
new file mode 100644
index 0000000000..a28e3c4f02
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/layered.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/list.png b/examples/declarative/particles/launcherContent/icons/list.png
new file mode 100644
index 0000000000..bc13263cff
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/list.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/overburst.png b/examples/declarative/particles/launcherContent/icons/overburst.png
new file mode 100644
index 0000000000..4ef0435991
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/overburst.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/package.png b/examples/declarative/particles/launcherContent/icons/package.png
new file mode 100644
index 0000000000..eba8951c26
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/package.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/plain.png b/examples/declarative/particles/launcherContent/icons/plain.png
new file mode 100644
index 0000000000..dd51498514
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/plain.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/plasmapatrol.png b/examples/declarative/particles/launcherContent/icons/plasmapatrol.png
new file mode 100644
index 0000000000..fda852b420
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/plasmapatrol.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/portal.png b/examples/declarative/particles/launcherContent/icons/portal.png
new file mode 100644
index 0000000000..9c1f910d0c
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/portal.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/rainbow.png b/examples/declarative/particles/launcherContent/icons/rainbow.png
new file mode 100644
index 0000000000..8841ea30f9
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/rainbow.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/remove.png b/examples/declarative/particles/launcherContent/icons/remove.png
new file mode 100644
index 0000000000..c37714ee8f
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/remove.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/samegame.png b/examples/declarative/particles/launcherContent/icons/samegame.png
new file mode 100644
index 0000000000..d00698264b
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/samegame.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/shimmer.png b/examples/declarative/particles/launcherContent/icons/shimmer.png
new file mode 100644
index 0000000000..0ff53196a6
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/shimmer.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/smile.png b/examples/declarative/particles/launcherContent/icons/smile.png
new file mode 100644
index 0000000000..f990e6c03e
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/smile.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/smilefactory.png b/examples/declarative/particles/launcherContent/icons/smilefactory.png
new file mode 100644
index 0000000000..78ea52790f
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/smilefactory.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/snow.png b/examples/declarative/particles/launcherContent/icons/snow.png
new file mode 100644
index 0000000000..d98e14b8ae
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/snow.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/spaceexplorer.png b/examples/declarative/particles/launcherContent/icons/spaceexplorer.png
new file mode 100644
index 0000000000..770584a0fa
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/spaceexplorer.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/spriteparticles.png b/examples/declarative/particles/launcherContent/icons/spriteparticles.png
new file mode 100644
index 0000000000..5603964939
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/spriteparticles.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/spritestateparticles.png b/examples/declarative/particles/launcherContent/icons/spritestateparticles.png
new file mode 100644
index 0000000000..dd01518ac4
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/spritestateparticles.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/spritevariedparticles.png b/examples/declarative/particles/launcherContent/icons/spritevariedparticles.png
new file mode 100644
index 0000000000..495bb6beee
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/spritevariedparticles.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/stream.png b/examples/declarative/particles/launcherContent/icons/stream.png
new file mode 100644
index 0000000000..a74f9a0340
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/stream.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/trails.png b/examples/declarative/particles/launcherContent/icons/trails.png
new file mode 100644
index 0000000000..0337ebcfd8
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/trails.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/turbulence.png b/examples/declarative/particles/launcherContent/icons/turbulence.png
new file mode 100644
index 0000000000..2b9446ea90
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/turbulence.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/ultraparticles.png b/examples/declarative/particles/launcherContent/icons/ultraparticles.png
new file mode 100644
index 0000000000..0d87eea427
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/ultraparticles.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/icons/velocityfrommotion.png b/examples/declarative/particles/launcherContent/icons/velocityfrommotion.png
new file mode 100644
index 0000000000..79baa08293
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/icons/velocityfrommotion.png
Binary files differ
diff --git a/examples/declarative/particles/launcherContent/launcher.js b/examples/declarative/particles/launcherContent/launcher.js
new file mode 100644
index 0000000000..e4fedd30d7
--- /dev/null
+++ b/examples/declarative/particles/launcherContent/launcher.js
@@ -0,0 +1,8 @@
+function nameFromPath(path){
+ var ret = path.split('/');
+ return ret[ret.length-1].split('.')[0];
+}
+function iconFromPath(path){
+ var ret = path.split('/');
+ return "launcherContent/icons/" + ret[ret.length-1].split('.')[0] + ".png";
+}
diff --git a/examples/declarative/particles/snow/snow.qml b/examples/declarative/particles/snow/snow.qml
index 2be2438f1d..41adccf7d7 100644
--- a/examples/declarative/particles/snow/snow.qml
+++ b/examples/declarative/particles/snow/snow.qml
@@ -41,6 +41,7 @@
import QtQuick 2.0
import QtQuick.Particles 2.0
import "content"
+import "../launcherContent" as UI
Rectangle{
width: 360
@@ -77,15 +78,15 @@ Rectangle{
Row{
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
- Button{
+ UI.Button{
text:"dx/dt"
onClicked: wanderer.physics = Wander.Position;
}
- Button{
+ UI.Button{
text:"dv/dt"
onClicked: wanderer.physics = Wander.Velocity;
}
- Button{
+ UI.Button{
text:"da/dt"
onClicked: wanderer.physics = Wander.Acceleration;
}