Embed some default particles.
authorAlan Alpert <aalpert@blackberry.com>
Mon, 1 Apr 2013 20:45:21 +0000 (13:45 -0700)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 15 Apr 2013 16:03:21 +0000 (18:03 +0200)
Most prototype level particle effects, at least in our example code,
uses basic and generic particles. Embedding these images into the
particles plugin will facilitate prototyping with the particles API.

Currently finding an image and copying it between projects is a
relatively large development cost for quick particle system prototypes.

Change-Id: I077104915353ab298e2aabd36e2a0a2070030914
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>

29 files changed:
examples/quick/particles/affectors/content/attractor.qml
examples/quick/particles/affectors/content/groupgoal.qml
examples/quick/particles/affectors/content/move.qml
examples/quick/particles/affectors/content/spritegoal.qml
examples/quick/particles/affectors/content/turbulence.qml
examples/quick/particles/customparticle/content/imagecolors.qml
examples/quick/particles/emitters/content/burstandpulse.qml
examples/quick/particles/emitters/content/customemitter.qml
examples/quick/particles/emitters/content/emitmask.qml
examples/quick/particles/emitters/content/maximumemitted.qml
examples/quick/particles/emitters/content/shapeanddirection.qml
examples/quick/particles/emitters/content/trailemitter.qml
examples/quick/particles/emitters/content/velocityfrommotion.qml
examples/quick/particles/imageparticle/content/colored.qml
examples/quick/particles/imageparticle/content/colortable.qml
examples/quick/particles/images.qrc
examples/quick/particles/system/content/dynamiccomparison.qml
examples/quick/particles/system/content/dynamicemitters.qml
examples/quick/particles/system/content/multiplepainters.qml
examples/quick/particles/system/content/startstop.qml
examples/quick/particles/system/content/timedgroupchanges.qml
src/particles/particleresources/fuzzydot.png [copied from examples/quick/particles/images/particle4.png with 100% similarity]
src/particles/particleresources/glowdot.png [copied from examples/quick/particles/images/particle.png with 100% similarity]
src/particles/particleresources/star.png [copied from examples/quick/particles/images/star.png with 100% similarity]
src/particles/particles.qrc
src/particles/qquickimageparticle.cpp
src/quick/doc/images/particles/fuzzydot.png [moved from examples/quick/particles/images/particle4.png with 100% similarity]
src/quick/doc/images/particles/glowdot.png [moved from examples/quick/particles/images/particle.png with 100% similarity]
src/quick/doc/images/particles/star.png [moved from examples/quick/particles/images/star.png with 100% similarity]

index fd7fd65..349132e 100644 (file)
@@ -77,7 +77,7 @@ Rectangle {
         ImageParticle {
             id: stars
             groups: ["stars"]
-            source: "../../images/star.png"
+            source: "qrc:///particleresources/star.png"
             color: "white"
             colorVariation: 0.1
             alpha: 0
@@ -96,7 +96,7 @@ Rectangle {
         ImageParticle {
             id: shot
             groups: ["shot"]
-            source: "../../images/star.png"
+            source: "qrc:///particleresources/star.png"
 
             color: "#0FF06600"
             colorVariation: 0.3
@@ -104,7 +104,7 @@ Rectangle {
         ImageParticle {
             id: engine
             groups: ["engine"]
-            source: "../../images/particle4.png"
+            source: "qrc:///particleresources/fuzzydot.png"
 
             color: "orange"
             SequentialAnimation on color {
index 19fa041..cf4361e 100644 (file)
@@ -124,7 +124,7 @@ Rectangle {
             id: smoke
             anchors.fill: parent
             groups: ["smoke"]
-            source: "../../images/particle.png"
+            source: "qrc:///particleresources/glowdot.png"
             colorVariation: 0
             color: "#00111111"
         }
@@ -132,7 +132,7 @@ Rectangle {
             id: pilot
             anchors.fill: parent
             groups: ["pilot"]
-            source: "../../images/particle.png"
+            source: "qrc:///particleresources/glowdot.png"
             redVariation: 0.01
             blueVariation: 0.4
             color: "#0010004f"
index b4d8331..e90f8c6 100644 (file)
@@ -50,7 +50,7 @@ Rectangle {
         ImageParticle {
             groups: ["A"]
             anchors.fill: parent
-            source: "../../images/star.png"
+            source: "qrc:///particleresources/star.png"
             color:"#FF1010"
             redVariation: 0.8
         }
@@ -80,7 +80,7 @@ Rectangle {
         ImageParticle {
             groups: ["B"]
             anchors.fill: parent
-            source: "../../images/star.png"
+            source: "qrc:///particleresources/star.png"
             color:"#10FF10"
             greenVariation: 0.8
         }
@@ -112,7 +112,7 @@ Rectangle {
         ImageParticle {
             groups: ["C"]
             anchors.fill: parent
-            source: "../../images/star.png"
+            source: "qrc:///particleresources/star.png"
             color:"#1010FF"
             blueVariation: 0.8
         }
index 78b161f..ab108bb 100644 (file)
@@ -66,7 +66,7 @@ Item {
     ImageParticle {
         system: sys
         groups: ["starfield"]
-        source: "../../images/star.png"
+        source: "qrc:///particleresources/star.png"
         colorVariation: 0.3
         color: "white"
     }
@@ -170,7 +170,7 @@ Item {
         z:0 
         system: sys
         groups: ["exhaust"]
-        source: "../../images/particle4.png"
+        source: "qrc:///particleresources/fuzzydot.png"
 
         color: "orange"
         SequentialAnimation on color {
index d7a8603..eacedbe 100644 (file)
@@ -75,13 +75,13 @@ Rectangle {
 
         ImageParticle {
             groups: ["smoke"]
-            source: "../../images/particle.png"
+            source: "qrc:///particleresources/glowdot.png"
             color: "#11111111"
             colorVariation: 0
         }
         ImageParticle {
             groups: ["flame"]
-            source: "../../images/particle.png"
+            source: "qrc:///particleresources/glowdot.png"
             color: "#11ff400f"
             colorVariation: 0.1
         }
index 130518a..3fb4c9f 100644 (file)
@@ -71,7 +71,7 @@ Rectangle {
             }
             Image {
                 id: particle
-                source: "../../images/particle4.png"
+                source: "qrc:///particleresources/fuzzydot.png"
             }
             //! [vertex]
             vertexShader:"
index 18d1c43..28c56b3 100644 (file)
@@ -67,7 +67,7 @@ Rectangle {
         id: particles
         anchors.fill: parent
         ImageParticle {
-            source: "../../images/star.png"
+            source: "qrc:///particleresources/star.png"
             alpha: 0
             colorVariation: 0.6
         }
index 966c78e..9ad504e 100644 (file)
@@ -90,7 +90,7 @@ ParticleSystem {
     }
 
     ImageParticle {
-        source: "../../images/particle4.png"
+        source: "qrc:///particleresources/fuzzydot.png"
         alpha: 0.0
     }
 }
index 08c04f6..1c2e7b4 100644 (file)
@@ -51,7 +51,7 @@ Rectangle {
         anchors.centerIn: parent
 
         ImageParticle {
-            source: "../../images/particle.png"
+            source: "qrc:///particleresources/glowdot.png"
             z: 2
             anchors.fill: parent
             color: "#336666CC"
index df92f05..4bd9079 100644 (file)
@@ -53,7 +53,7 @@ Rectangle {
         ImageParticle {
             system: sys
             id: cp
-            source: "../../images/particle.png"
+            source: "qrc:///particleresources/glowdot.png"
             colorVariation: 0.4
             color: "#000000FF"
         }
index 1dec5b2..0ca433c 100644 (file)
@@ -58,7 +58,7 @@ Rectangle {
         ImageParticle {
             groups: ["center","edge"]
             anchors.fill: parent
-            source: "../../images/particle.png"
+            source: "qrc:///particleresources/glowdot.png"
             colorVariation: 0.1
             color: "#009999FF"
         }
index a4972b7..3186b51 100644 (file)
@@ -56,7 +56,7 @@ Rectangle {
             system: particles
             anchors.fill: parent
             groups: ["A", "B"]
-            source: "../../images/particle.png"
+            source: "qrc:///particleresources/glowdot.png"
             colorVariation: 0
             color: "#00111111"
         }
@@ -65,7 +65,7 @@ Rectangle {
             anchors.fill: parent
             system: particles
             groups: ["C", "D"]
-            source: "../../images/particle.png"
+            source: "qrc:///particleresources/glowdot.png"
             colorVariation: 0.1
             color: "#00ff400f"
         }
index 1f1d660..d325f9b 100644 (file)
@@ -61,7 +61,7 @@ Rectangle {
     ParticleSystem { id: sys1 }
     ImageParticle {
         system: sys1
-        source: "../../images/particle.png"
+        source: "qrc:///particleresources/glowdot.png"
         color: "cyan"
         alpha: 0
         SequentialAnimation on color {
@@ -127,7 +127,7 @@ Rectangle {
             }
         }
         colorVariation: 0.5
-        source: "../../images/star.png"
+        source: "qrc:///particleresources/star.png"
     }
     Emitter {
         id: trailsStars
@@ -149,7 +149,7 @@ Rectangle {
     }
     ParticleSystem { id: sys3; }
     ImageParticle {
-        source: "../../images/particle.png"
+        source: "qrc:///particleresources/glowdot.png"
         system: sys3
         color: "orange"
         alpha: 0
@@ -191,7 +191,7 @@ Rectangle {
     ParticleSystem { id: sys4; }
     ImageParticle {
         system: sys4
-        source: "../../images/star.png"
+        source: "qrc:///particleresources/star.png"
         color: "green"
         alpha: 0
         SequentialAnimation on color {
index 939ec7e..236cc0f 100644 (file)
@@ -50,7 +50,7 @@ Rectangle {
         ImageParticle {
             groups: ["stars"]
             anchors.fill: parent
-            source: "../../images/star.png"
+            source: "qrc:///particleresources/star.png"
         }
         Emitter {
             group: "stars"
@@ -64,7 +64,7 @@ Rectangle {
         // ![0]
         ImageParticle {
             anchors.fill: parent
-            source: "../../images/star.png"
+            source: "qrc:///particleresources/star.png"
             alpha: 0
             alphaVariation: 0.2
             colorVariation: 1.0
index 4090163..87b5ae2 100644 (file)
@@ -55,7 +55,7 @@ Rectangle {
         alpha: 0
 
         //! [0]
-        source: "../../images/particle.png"
+        source: "qrc:///particleresources/glowdot.png"
         colorTable: "../../images/colortable.png"
         sizeTable: "../../images/colortable.png"
         //! [0]
index 9f284a0..1f75483 100644 (file)
         <file>images/meteor.png</file>
         <file>images/meteors.png</file>
         <file>images/nullRock.png</file>
-        <file>images/particle.png</file>
         <file>images/particle2.png</file>
         <file>images/particle3.png</file>
-        <file>images/particle4.png</file>
         <file>images/particleA.png</file>
         <file>images/portal_bg.png</file>
         <file>images/realLeaf1.png</file>
@@ -27,7 +25,6 @@
         <file>images/sizeInOut.png</file>
         <file>images/snowflake.png</file>
         <file>images/sparkleSize.png</file>
-        <file>images/star.png</file>
         <file>images/starfish_0.png</file>
         <file>images/starfish_1.png</file>
         <file>images/starfish_2.png</file>
index 247a25a..9db7c0a 100644 (file)
@@ -52,7 +52,7 @@ Rectangle {
 
     ImageParticle {
         system: sys
-        source: "../../images/particle.png"
+        source: "qrc:///particleresources/glowdot.png"
         color: "white"
         colorVariation: 1.0
         alpha: 0.1
@@ -90,7 +90,7 @@ Rectangle {
                 property int lifeSpan: 10000
                 width: 32
                 height: 32
-                source: "../../images/particle.png"
+                source: "qrc:///particleresources/glowdot.png"
                 y: 0
                 PropertyAnimation on y {from: -16; to: root.height-16; duration: container.lifeSpan; running: true}
                 SequentialAnimation on opacity {
index 10ac33b..72ec1ff 100644 (file)
@@ -51,7 +51,7 @@ Rectangle {
     }
     ImageParticle {
         system: sys
-        source: "../../images/particle.png"
+        source: "qrc:///particleresources/glowdot.png"
         color: "white"
         colorVariation: 1.0
         alpha: 0.1
index 8a38874..e0a1288 100644 (file)
@@ -91,6 +91,6 @@ Rectangle {
         height: 240
         width: root.width
         z: 1
-        source: "../../images/particle.png"
+        source: "qrc:///particleresources/glowdot.png"
     }
 }
index 5ce8729..e787919 100644 (file)
@@ -69,7 +69,7 @@ Rectangle {
     ImageParticle {
         anchors.fill: parent
         system: particles
-        source: "../../images/star.png"
+        source: "qrc:///particleresources/star.png"
         sizeTable: "../../images/sparkleSize.png"
         alpha: 0
         colorVariation: 0.6
index 6443878..7131633 100644 (file)
@@ -119,7 +119,7 @@ Rectangle {
 
         ImageParticle {
             groups: ["works", "fire", "splode"]
-            source: "../../images/particle.png"
+            source: "qrc:///particleresources/glowdot.png"
             entryEffect: ImageParticle.Scale
         }
     }
index 344f948..5825204 100644 (file)
@@ -1,5 +1,8 @@
 <RCC>
     <qresource prefix="/">
         <file>particleresources/noise.png</file>
+        <file>particleresources/fuzzydot.png</file>
+        <file>particleresources/glowdot.png</file>
+        <file>particleresources/star.png</file>
     </qresource>
 </RCC>
index e0572ef..9a0601b 100644 (file)
@@ -623,6 +623,22 @@ void fillUniformArrayFromImage(float* array, const QImage& img, int size)
     The source image to be used.
 
     If the image is a sprite animation, use the sprite property instead.
+
+    Since Qt 5.2, some default images are provided as resources to aid prototyping:
+    \table
+    \row
+    \li qrc:///particleresources/star.png
+    \li \inlineimage particles/star.png
+    \row
+    \li qrc:///particleresources/glowdot.png
+    \li \inlineimage particles/glowdot.png
+    \row
+    \li qrc:///particleresources/fuzzydot.png
+    \li \inlineimage particles/fuzzydot.png
+    \endtable
+
+    Note that the images are white and semi-transparent, to allow colorization
+    and alpha levels to have maximum effect.
 */
 /*!
     \qmlproperty list<Sprite> QtQuick.Particles2::ImageParticle::sprites