From 8be9f08b8d1db93d5d7e17a4348a7d3cb2fe6c95 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 6 Jun 2012 20:28:17 +1000 Subject: [PATCH] Update Affector folder of examples to guidelines Change-Id: I1fa0e8424f94cf954098b7734ba25feab0790828 Reviewed-by: Bea Lam --- doc/src/images/qml-affectors-example.png | Bin 0 -> 22074 bytes examples/particles/affectors/affectors.pro | 10 + examples/particles/affectors/affectors.qml | 149 ++++++++++++++ examples/particles/affectors/affectors.qmlproject | 16 ++ examples/particles/affectors/age.qml | 97 --------- examples/particles/affectors/attractor.qml | 213 ------------------- examples/particles/affectors/content/age.qml | 99 +++++++++ examples/particles/affectors/content/attractor.qml | 199 ++++++++++++++++++ .../particles/affectors/content/customaffector.qml | 176 ++++++++++++++++ examples/particles/affectors/content/friction.qml | 112 ++++++++++ examples/particles/affectors/content/gravity.qml | 105 ++++++++++ examples/particles/affectors/content/groupgoal.qml | 203 +++++++++++++++++++ examples/particles/affectors/content/move.qml | 147 ++++++++++++++ .../particles/affectors/content/spritegoal.qml | 214 ++++++++++++++++++++ .../particles/affectors/content/turbulence.qml | 138 +++++++++++++ examples/particles/affectors/content/wander.qml | 97 +++++++++ examples/particles/affectors/customaffector.qml | 173 ---------------- examples/particles/affectors/friction.qml | 109 ---------- examples/particles/affectors/gravity.qml | 103 ---------- examples/particles/affectors/groupgoal.qml | 193 ------------------ examples/particles/affectors/main.cpp | 41 ++++ examples/particles/affectors/move.qml | 141 ------------- examples/particles/affectors/spritegoal.qml | 212 ------------------- examples/particles/affectors/turbulence.qml | 135 ------------ examples/particles/affectors/wander.qml | 95 --------- examples/shared/Button.qml | 2 +- 26 files changed, 1707 insertions(+), 1472 deletions(-) create mode 100644 doc/src/images/qml-affectors-example.png create mode 100644 examples/particles/affectors/affectors.pro create mode 100644 examples/particles/affectors/affectors.qml create mode 100644 examples/particles/affectors/affectors.qmlproject delete mode 100644 examples/particles/affectors/age.qml delete mode 100644 examples/particles/affectors/attractor.qml create mode 100644 examples/particles/affectors/content/age.qml create mode 100644 examples/particles/affectors/content/attractor.qml create mode 100644 examples/particles/affectors/content/customaffector.qml create mode 100644 examples/particles/affectors/content/friction.qml create mode 100644 examples/particles/affectors/content/gravity.qml create mode 100644 examples/particles/affectors/content/groupgoal.qml create mode 100644 examples/particles/affectors/content/move.qml create mode 100644 examples/particles/affectors/content/spritegoal.qml create mode 100644 examples/particles/affectors/content/turbulence.qml create mode 100644 examples/particles/affectors/content/wander.qml delete mode 100644 examples/particles/affectors/customaffector.qml delete mode 100644 examples/particles/affectors/friction.qml delete mode 100644 examples/particles/affectors/gravity.qml delete mode 100644 examples/particles/affectors/groupgoal.qml create mode 100644 examples/particles/affectors/main.cpp delete mode 100644 examples/particles/affectors/move.qml delete mode 100644 examples/particles/affectors/spritegoal.qml delete mode 100644 examples/particles/affectors/turbulence.qml delete mode 100644 examples/particles/affectors/wander.qml diff --git a/doc/src/images/qml-affectors-example.png b/doc/src/images/qml-affectors-example.png new file mode 100644 index 0000000000000000000000000000000000000000..748afa65e54687776ec78c69fc998b00be813c2d GIT binary patch literal 22074 zcmeFZ^;cWZ7dDDJ#jUt|fZ$f#rMOFRC`XechlDSh+# zzU%%I_ue1Q$y&**IWx2MdGO zusu~xy%E1JBQ6`{i;h%fBqRnTHAOiC|NN6a^JHeVO!%GT_)LMlqP>yh#uG4WEYa7I zWyTrJ8Pn`gE*wdX@K5z@u}4#Qf8Hi~EejT5Pr66+RISc+!lE6aA@wI{>DE+wGLX#h_~2|Ns5}GbccF{)k2c zH;6;wHq7Mu!^9%U_Ac#HO}?7%vXlSo&O>o1CJR=6)fEc|g&Yd{3vDH%ApWZkA0rQy&eI?_Q6HkOatiCXP-VxdLA2EG2_tsU@xTG*kmAQ8YGmnkIw5O zyVOdRV7(i|y0)_wNw?jgnzA3W&zZBhcgOwT@HddD)suOEqDjKMOC5e%-4C1aa8q$E z6Y=`U5*8p;b|moiGg#g4PD2`K@rMSUX;SS;l&&4+@M)hjhze$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zX?org26J^CpjS$5S&GJl;*!Lolf#ytgpG4^GwFXj7y4C;y79HTnRj7#_rmPlTt!C? z9Ya!68r^-S^`zA2d&F_Vp97L+(2voNLBz3Q?jE{-l;>>)u&*<(rEYhfh!V$3OoTBO zSE;Mn6bd1;@`4r}vv*^q5=5)Ix_bTaD4epKR2lg1?h}uPbg#w-@FV^w(Eodxe6n9O WCDp^SUPwO-_LP~CrC}}9J^nvw=xJX7 literal 0 HcmV?d00001 diff --git a/examples/particles/affectors/affectors.pro b/examples/particles/affectors/affectors.pro new file mode 100644 index 0000000..52eb0dd --- /dev/null +++ b/examples/particles/affectors/affectors.pro @@ -0,0 +1,10 @@ +TEMPLATE = app + +QT += quick qml +SOURCES += main.cpp + +target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles/affectors +qml.files = affectors.qml content +qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles/affectors +INSTALLS += target qml + diff --git a/examples/particles/affectors/affectors.qml b/examples/particles/affectors/affectors.qml new file mode 100644 index 0000000..08f1dfe --- /dev/null +++ b/examples/particles/affectors/affectors.qml @@ -0,0 +1,149 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 "../../shared" as Examples + +/*! + \title QtQuick.Particles Examples - Affectors + \example particles/affectors + \brief This is a collection of examples using Affectors in the QML particle system. + \image qml-affectors-example.png + + This is a collection of small QML examples relating to using Affectors in the particle system. + Each example is a small QML file emphasizing a particular element or feature. + + Age demonstrates using an Age affector to prematurely end the lives of particles. + \snippet examples/particles/affectors/content/age.qml 0 + + As you move the affector around the screen, the particles inside it + (which haven't already been affected) jump to a period near the end + of their life. This gives them a short period to finish fading out, + but changing lifeLeft to 0 (the default), would cause them to reach + the end of their life instantly. + + Attractor demonstrates using an Attractor affector to simulate a black hole + \snippet examples/particles/affectors/content/attractor.qml 0 + + All particles in the scene, including the rocket ship's exhaust and pellets, are pulled + towards the black hole. This effect is stronger closer to the black hole, so the + asteroids near the top of the screen are barely affected at all, while the ones + towards the middle sometimes curve drastically. To complete the effect, an Age + affector covers the black hole to destroy particles which come in contact with it. + + Custom Affector manipulates the properties of the particles directly in javascript. + One Affector is used to make the leaves rock back and forth as they fall, looking more + leaf-like than just spinning in circles: + \snippet examples/particles/affectors/content/customaffector.qml 0 + Another is used to provide a slightly varying friction to the leaves as they 'land', + to look more natural: + \snippet examples/particles/affectors/content/customaffector.qml 1 + + Friction is similar to the falling leaves in the custom affector, except that it uses a + flat friction the whole way down instead of custom affectors. + \snippet examples/particles/affectors/content/friction.qml 0 + + Gravity is a convenience affector for applying a constant acceleration to particles inside it + \snippet examples/particles/affectors/content/gravity.qml 0 + + GroupGoal sets up two particle groups for flaming and non-flaming balls, and gives you various + ways to transition between them. + \snippet examples/particles/affectors/content/groupgoal.qml unlit + The non-flaming balls have a one in a hundred chance of lighting on their own each second, but they also + have a GroupGoal set on the whole group. This affector affects all particles of the unlit group, when colliding + with particles in the lit group, and cause them to move to the lighting group. + \snippet examples/particles/affectors/content/groupgoal.qml lighting + lighting is an intermediate group so that the glow builds up and the transition is less jarring. So it automatically + moves into the lit group after 100ms. + \snippet examples/particles/affectors/content/groupgoal.qml lit + The lit group also has TrailEmitters on it for additional fire and smoke, but does not transition anywhere. + There are two more GroupGoal elements that allow particles in the unlit group to transition to the lighting group + (and then to the lit group). + \snippet examples/particles/affectors/content/groupgoal.qml groupgoal-pilot + The first is just an area bound to the location of an image of a pilot flame. When unlit balls pass through the flame, + they go straight to lit because the pilot flame is so hot. + \snippet examples/particles/affectors/content/groupgoal.qml groupgoal-ma + The second is bound to the location of the last pointer interaction, so that touching or clicking on unlit balls (which + is hard due to their constant movement) causes them to move to the lighting group. + + Move shows some simple effects you can get by altering trajectory midway. + The red particles have an affector that affects their position, jumping them forwards by 120px. + \snippet examples/particles/affectors/content/move.qml A + The green particles have an affector that affects their velocity, but with some angle variation. By adding some random direction + velocity to their existing forwards velocity, they begin to spray off in a cone. + \snippet examples/particles/affectors/content/move.qml B + The blue particles have an affector that affects their acceleration, and because it sets relative to false this resets the acceleration instead of + adding to it. Once the blue particles reach the affector, their horizontal velocity stops increasing as their vertical velocity decreases. + \snippet examples/particles/affectors/content/move.qml C + + SpriteGoal has an affector which interacts with the sprite engine of particles, if they are being drawn as sprites by ImageParticle. + \snippet examples/particles/affectors/content/spritegoal.qml 0 + The SpriteGoal follows the image of the rocket ship on screen, and when it interacts with particles drawn by ImageParticle as sprites, + it instructs them to move immediately to the "explode" state, which in this case is the animation of the asteroid breaking into many pieces. + + Turbulence has a flame with smoke, and both sets of particles being affected by a Turbulence affector. This gives a faint wind effect. + \snippet examples/particles/affectors/content/turbulence.qml 0 + To make the wind change direction, subsitute a black and white noise image in the noiseSource parameter (it currently uses a default noise source). + + Wander uses a Wander affector to add some horizontal drift to snowflakes as they fall down. + \snippet examples/particles/affectors/content/wander.qml 0 + There are different movements given by applying the Wander to different attributes of the trajectory, so the example makes it easy to play around and see the difference. +*/ + +Item { + height: 480 + width: 320 + Examples.LauncherList { + id: ll + anchors.fill: parent + Component.onCompleted: { + addExample("Age", "Kills off particles that enter the affector", Qt.resolvedUrl("content/age.qml")); + addExample("Attractor", "Simulates a small black hole", Qt.resolvedUrl("content/attractor.qml")); + addExample("Custom Affector", "Custom falling leaves", Qt.resolvedUrl("content/customaffector.qml")); + addExample("Friction", "Leaves that slow down as they fall", Qt.resolvedUrl("content/friction.qml")); + addExample("Gravity", "Leaves that fall towards the earth as you move it", Qt.resolvedUrl("content/gravity.qml")); + addExample("GroupGoal", "Balls that can be set on fire various ways", Qt.resolvedUrl("content/groupgoal.qml")); + addExample("Move", "Some effects you can get by altering trajectory midway", Qt.resolvedUrl("content/move.qml")); + addExample("SpriteGoal", "A ship that makes asteroids explode", Qt.resolvedUrl("content/spritegoal.qml")); + addExample("Turbulence", "A candle with faint wind", Qt.resolvedUrl("content/turbulence.qml")); + addExample("Wander", "Drifting snow flakes", Qt.resolvedUrl("content/wander.qml")); + } + } +} diff --git a/examples/particles/affectors/affectors.qmlproject b/examples/particles/affectors/affectors.qmlproject new file mode 100644 index 0000000..2bf3387 --- /dev/null +++ b/examples/particles/affectors/affectors.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.1 + +Project { + mainFile: "affectors.qml" + + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } +} diff --git a/examples/particles/affectors/age.qml b/examples/particles/affectors/age.qml deleted file mode 100644 index ea1b302..0000000 --- a/examples/particles/affectors/age.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 - -Rectangle { - id: root - width: 360 - height: 600 - color: "white" - - ParticleSystem { id: particles } - - ImageParticle { - system: particles - sprites: Sprite { - name: "snow" - source: "../images/snowflake.png" - frameCount: 51 - frameDuration: 40 - frameDurationVariation: 8 - } - } - - Emitter { - system: particles - emitRate: 20 - lifeSpan: 8000 - speed: PointDirection { y:80; yVariation: 40; } - acceleration: PointDirection { y: 4 } - size: 36 - endSize: 12 - sizeVariation: 8 - width: parent.width - height: 100 - } - - MouseArea { - id: ma - anchors.fill: parent - hoverEnabled: true - } - - Rectangle { - color: "#803333AA" - border.color: "black" - x: ma.mouseX - 36 - y: ma.mouseY - 36 - width: 72 - height: 72 - Age { - anchors.fill: parent - system: particles - once: true - lifeLeft: 1200 - advancePosition: false - } - } -} diff --git a/examples/particles/affectors/attractor.qml b/examples/particles/affectors/attractor.qml deleted file mode 100644 index 0d50937..0000000 --- a/examples/particles/affectors/attractor.qml +++ /dev/null @@ -1,213 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** 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 - -Rectangle { - id: root - width: 360 - height: 540 - color: "black" - property bool spacePressed: false - focus: true - Image { - source: "../images/finalfrontier.png" - anchors.centerIn:parent - } - Keys.onPressed: { - if (event.key == Qt.Key_Space) { - spacePressed = true; - event.accepted = true; - } - } - Keys.onReleased: { - if (event.key == Qt.Key_Space) { - spacePressed = false; - event.accepted = true; - } - } - - Emitter { - group: "stars" - system: particles - emitRate: 40 - lifeSpan: 4000 - enabled: true - size: 30 - sizeVariation: 10 - speed: PointDirection { x: 220; xVariation: 40 } - height: parent.height - } - Emitter { - group: "roids" - system: particles - emitRate: 10 - lifeSpan: 4000 - enabled: true - size: 30 - sizeVariation: 10 - speed: PointDirection { x: 220; xVariation: 40 } - height: parent.height - } - ParticleSystem { - id: particles - anchors.fill: parent - } - ImageParticle { - id: stars - groups: ["stars"] - system: particles - source: "../images/star.png" - color: "white" - colorVariation: 0.1 - alpha: 0 - } - ImageParticle { - id: roids - groups: ["roids"] - system: particles - sprites: Sprite { - id: spinState - name: "spinning" - source: "../images/meteor.png" - frameCount: 35 - frameDuration: 60 - } - } - ImageParticle { - id: shot - groups: ["shot"] - system: particles - source: "../images/star.png" - - color: "#0FF06600" - colorVariation: 0.3 - } - ImageParticle { - id: engine - groups: ["engine"] - system: particles - source: "../images/particle4.png" - - color: "orange" - SequentialAnimation on color { - loops: Animation.Infinite - ColorAnimation { - from: "red" - to: "cyan" - duration: 1000 - } - ColorAnimation { - from: "cyan" - to: "red" - duration: 1000 - } - } - - colorVariation: 0.2 - } - Attractor { - id: gs; pointX: root.width/2; pointY: root.height/2; strength: 4000000; - system: particles - affectedParameter: Attractor.Acceleration - proportionalToDistance: Attractor.InverseQuadratic - } - Age { - system: particles - x: gs.pointX - 8; - y: gs.pointY - 8; - width: 16 - height: 16 - } - Rectangle { - color: "black" - width: 8 - height: 8 - radius: 4 - x: gs.pointX - 4 - y: gs.pointY - 4 - } - - Image { - source:"../images/rocket2.png" - id: ship - width: 45 - height: 22 - MouseArea { - id: ma - anchors.fill: parent; - drag.axis: Drag.XandYAxis - drag.target: ship - } - } - Emitter { - group: "engine" - system: particles - emitRate: 200 - lifeSpan: 1000 - size: 10 - endSize: 4 - sizeVariation: 4 - speed: PointDirection { x: -128; xVariation: 32 } - height: ship.height - y: ship.y - x: ship.x - width: 20 - } - Emitter { - group: "shot" - system: particles - emitRate: 32 - lifeSpan: 2000 - enabled: spacePressed - size: 40 - speed: PointDirection { x: 256; } - x: ship.x + ship.width - y: ship.y + ship.height/2 - } - - Text { - color: "white" - anchors.bottom: parent.bottom - text:"Drag the ship, Spacebar to fire." - } -} - diff --git a/examples/particles/affectors/content/age.qml b/examples/particles/affectors/content/age.qml new file mode 100644 index 0000000..ba52ce2 --- /dev/null +++ b/examples/particles/affectors/content/age.qml @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 + +Rectangle { + id: root + width: 360 + height: 600 + color: "white" + + ParticleSystem { id: particles } + + ImageParticle { + system: particles + sprites: Sprite { + name: "snow" + source: "../../images/snowflake.png" + frameCount: 51 + frameDuration: 40 + frameDurationVariation: 8 + } + } + + Emitter { + system: particles + emitRate: 20 + lifeSpan: 8000 + speed: PointDirection { y:80; yVariation: 40; } + acceleration: PointDirection { y: 4 } + size: 36 + endSize: 12 + sizeVariation: 8 + width: parent.width + height: 100 + } + + MouseArea { + id: ma + anchors.fill: parent + hoverEnabled: true + } + + Rectangle { + color: "#803333AA" + border.color: "black" + x: ma.mouseX - 36 + y: ma.mouseY - 36 + width: 72 + height: 72 + //! [0] + Age { + anchors.fill: parent + system: particles + once: true + lifeLeft: 1200 + advancePosition: false + } + //! [0] + } +} diff --git a/examples/particles/affectors/content/attractor.qml b/examples/particles/affectors/content/attractor.qml new file mode 100644 index 0000000..16a553f --- /dev/null +++ b/examples/particles/affectors/content/attractor.qml @@ -0,0 +1,199 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 + +Rectangle { + id: root + width: 360 + height: 540 + color: "black" + Image { + source: "../../images/finalfrontier.png" + anchors.centerIn:parent + } + Emitter { + group: "stars" + system: particles + emitRate: 40 + lifeSpan: 4000 + enabled: true + size: 30 + sizeVariation: 10 + speed: PointDirection { x: 220; xVariation: 40 } + height: parent.height + } + Emitter { + group: "roids" + system: particles + emitRate: 10 + lifeSpan: 4000 + enabled: true + size: 30 + sizeVariation: 10 + speed: PointDirection { x: 220; xVariation: 40 } + height: parent.height + } + ParticleSystem { + id: particles + anchors.fill: parent + } + ImageParticle { + id: stars + groups: ["stars"] + system: particles + source: "../../images/star.png" + color: "white" + colorVariation: 0.1 + alpha: 0 + } + ImageParticle { + id: roids + groups: ["roids"] + system: particles + sprites: Sprite { + id: spinState + name: "spinning" + source: "../../images/meteor.png" + frameCount: 35 + frameDuration: 60 + } + } + ImageParticle { + id: shot + groups: ["shot"] + system: particles + source: "../../images/star.png" + + color: "#0FF06600" + colorVariation: 0.3 + } + ImageParticle { + id: engine + groups: ["engine"] + system: particles + source: "../../images/particle4.png" + + color: "orange" + SequentialAnimation on color { + loops: Animation.Infinite + ColorAnimation { + from: "red" + to: "cyan" + duration: 1000 + } + ColorAnimation { + from: "cyan" + to: "red" + duration: 1000 + } + } + + colorVariation: 0.2 + } + //! [0] + Attractor { + id: gs; pointX: root.width/2; pointY: root.height/2; strength: 4000000; + system: particles + affectedParameter: Attractor.Acceleration + proportionalToDistance: Attractor.InverseQuadratic + } + //! [0] + Age { + system: particles + x: gs.pointX - 8; + y: gs.pointY - 8; + width: 16 + height: 16 + } + Rectangle { + color: "black" + width: 8 + height: 8 + radius: 4 + x: gs.pointX - 4 + y: gs.pointY - 4 + } + + Image { + source:"../../images/rocket2.png" + id: ship + width: 45 + height: 22 + //Automatic movement + SequentialAnimation on x { + loops: -1 + NumberAnimation{to: root.width-45; easing.type: Easing.InOutQuad; duration: 2000} + 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} + } + } + Emitter { + group: "engine" + system: particles + emitRate: 200 + lifeSpan: 1000 + size: 10 + endSize: 4 + sizeVariation: 4 + speed: 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 + speed: PointDirection { x: 256; } + x: ship.x + ship.width + y: ship.y + ship.height/2 + } +} + diff --git a/examples/particles/affectors/content/customaffector.qml b/examples/particles/affectors/content/customaffector.qml new file mode 100644 index 0000000..2abb72d --- /dev/null +++ b/examples/particles/affectors/content/customaffector.qml @@ -0,0 +1,176 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** 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 + +Item { + width: 360 + height: 600 + + Image { + source: "../../images/backgroundLeaves.jpg" + anchors.fill: parent + } + ParticleSystem { + id: sys + } + Emitter { + system: sys + width: parent.width + emitRate: 4 + lifeSpan: 14000 + size: 80 + speed: PointDirection { y: 60 } + } + Wander { + system: sys + anchors.fill: parent + anchors.bottomMargin: 100 + xVariance: 60 + pace: 60 + } + + //! [0] + Affector { + system: sys + property real coefficient: 0.1 + property real speed: 1.5 + width: parent.width + height: parent.height - 100 + onAffectParticles: { + /* //Linear movement + if (particle.r == 0) { + particle.r = Math.random() > 0.5 ? -1 : 1; + }else if (particle.r == 1) { + particle.rotation += speed * dt; + if(particle.rotation >= maxAngle) + particle.r = -1; + }else if (particle.r == -1) { + particle.rotation -= speed * dt; + if(particle.rotation <= -1 * maxAngle) + particle.r = 1; + } + */ + //Wobbly movement + for (var i=0; i 0.5 ? -1 : 1; - }else if (particle.r == 1) { - particle.rotation += speed * dt; - if(particle.rotation >= maxAngle) - particle.r = -1; - }else if (particle.r == -1) { - particle.rotation -= speed * dt; - if(particle.rotation <= -1 * maxAngle) - particle.r = 1; - } - */ - //Wobbly movement - for (var i=0; i