diff options
Diffstat (limited to 'examples/declarative/particles/allsmiles')
18 files changed, 604 insertions, 0 deletions
diff --git a/examples/declarative/particles/allsmiles/content/particle.png b/examples/declarative/particles/allsmiles/content/particle.png Binary files differnew file mode 100644 index 0000000000..5c83896d22 --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/particle.png diff --git a/examples/declarative/particles/allsmiles/content/singlesmile.png b/examples/declarative/particles/allsmiles/content/singlesmile.png Binary files differnew file mode 100644 index 0000000000..4087fa6b7f --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/singlesmile.png diff --git a/examples/declarative/particles/allsmiles/content/sizeInOut.png b/examples/declarative/particles/allsmiles/content/sizeInOut.png Binary files differnew file mode 100644 index 0000000000..0a306ea21a --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/sizeInOut.png diff --git a/examples/declarative/particles/allsmiles/content/smileMask.png b/examples/declarative/particles/allsmiles/content/smileMask.png Binary files differnew file mode 100644 index 0000000000..65a0143e9e --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/smileMask.png diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite.png b/examples/declarative/particles/allsmiles/content/squarefacesprite.png Binary files differnew file mode 100644 index 0000000000..f9a5d5fcce --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/squarefacesprite.png diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite2.png b/examples/declarative/particles/allsmiles/content/squarefacesprite2.png Binary files differnew file mode 100644 index 0000000000..7106a520a4 --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/squarefacesprite2.png diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite3.png b/examples/declarative/particles/allsmiles/content/squarefacesprite3.png Binary files differnew file mode 100644 index 0000000000..f4e6f26856 --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/squarefacesprite3.png diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite4.png b/examples/declarative/particles/allsmiles/content/squarefacesprite4.png Binary files differnew file mode 100644 index 0000000000..1e094eed4a --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/squarefacesprite4.png diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite5.png b/examples/declarative/particles/allsmiles/content/squarefacesprite5.png Binary files differnew file mode 100644 index 0000000000..1cfc5c7f8c --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/squarefacesprite5.png diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite6.png b/examples/declarative/particles/allsmiles/content/squarefacesprite6.png Binary files differnew file mode 100644 index 0000000000..b040139a9e --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/squarefacesprite6.png diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite7.png b/examples/declarative/particles/allsmiles/content/squarefacesprite7.png Binary files differnew file mode 100644 index 0000000000..b1e5e4e339 --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/squarefacesprite7.png diff --git a/examples/declarative/particles/allsmiles/content/squarefacespriteX.png b/examples/declarative/particles/allsmiles/content/squarefacespriteX.png Binary files differnew file mode 100644 index 0000000000..93a0181dd0 --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/squarefacespriteX.png diff --git a/examples/declarative/particles/allsmiles/content/squarefacespriteXX.png b/examples/declarative/particles/allsmiles/content/squarefacespriteXX.png Binary files differnew file mode 100644 index 0000000000..3159efe246 --- /dev/null +++ b/examples/declarative/particles/allsmiles/content/squarefacespriteXX.png diff --git a/examples/declarative/particles/allsmiles/smile.qml b/examples/declarative/particles/allsmiles/smile.qml new file mode 100644 index 0000000000..e37e8fa98e --- /dev/null +++ b/examples/declarative/particles/allsmiles/smile.qml @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** 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 Qt.labs.particles 2.0 + +Rectangle{ + color: "white" + width: 310 + height: 300 + ParticleSystem{ id: sys } + Picture{ + system: sys + anchors.fill: parent + image: "content/singlesmile.png" + onceOff: true + } + ColoredParticle{ + system: sys + image: "content/particle.png" + color: "black" + alpha: 0.4 + sizeTable: "content/sizeInOut.png" + } + TrailEmitter{ + id: emitter + system: sys + emitting: false + particleDuration: 4000 + maxParticles: 1200 + anchors.fill: parent + particleSize: 32 + speed: PointVector{ xVariation: 12; yVariation: 12 } + } + MouseArea{ + anchors.fill: parent + onClicked: emitter.burst(1200); + } +} + diff --git a/examples/declarative/particles/allsmiles/smilefactory.qml b/examples/declarative/particles/allsmiles/smilefactory.qml new file mode 100644 index 0000000000..1b43adb1da --- /dev/null +++ b/examples/declarative/particles/allsmiles/smilefactory.qml @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** 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 Qt.labs.particles 2.0 + +Rectangle{ + color: "goldenrod" + width: 400 + height: 400 + ParticleSystem{id:sys} + DeformableParticle{ + system: sys + particles: ["goingLeft", "goingRight"] + image: "content/singlesmile.png" + rotation: 90 + autoRotation: true + } + DeformableParticle{ + system: sys + particles: ["goingDown"] + image: "content/squarefacespriteXX.png" + rotation: 180 + yVector: PointVector{ y: 0.5; yVariation: 0.25; xVariation: 0.25; } + } + Timer{ + running: true + repeat: false + interval: 100 + onTriggered: emitA.emitting = true; + } + Timer{ + running: true + repeat: false + interval: 4200 + onTriggered: emitB.emitting = true; + } + Timer{ + running: true + repeat: false + interval: 8400 + onTriggered: emitC.emitting = true; + } + TrailEmitter{ + id: emitA + x: 0 + y: 120 + system: sys + emitting: false + particle: "goingRight" + speed: PointVector{ x: 100 } + particleDuration: 4000 + particlesPerSecond: 2 + particleSize: 32 + } + TrailEmitter{ + id: emitB + x: 400 + y: 240 + system: sys + emitting: false + particle: "goingLeft" + speed: PointVector{ x: -100 } + particleDuration: 4000 + particlesPerSecond: 2 + particleSize: 32 + } + TrailEmitter{ + id: emitC + x: 0 + y: 360 + system: sys + emitting: false + particle: "goingDown" + speed: PointVector{ x: 100 } + particleDuration: 4000 + particlesPerSecond: 2 + particleSize: 32 + } +} diff --git a/examples/declarative/particles/allsmiles/spriteparticles.qml b/examples/declarative/particles/allsmiles/spriteparticles.qml new file mode 100644 index 0000000000..4bcb7081b8 --- /dev/null +++ b/examples/declarative/particles/allsmiles/spriteparticles.qml @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** 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 Qt.labs.particles 2.0 + +Rectangle{ + color: "goldenrod" + width: 400 + height: 400 + ColoredParticle{ + id: test + particles: ["Test"] + image: "content/particle.png" + system: sys + z: 2 + anchors.fill: parent + color: "#336666CC" + colorVariation: 0.0 + } + SpriteParticle{ + id: single + particles: ["Face"] + system: sys + z: 2 + anchors.fill: parent + Sprite{ + source: "content/squarefacesprite.png" + frames: 6 + duration: 120 + } + } + Mask{ + id: mask + source: "content/smileMask.png" + } + TrailEmitter{ + system: sys + particle: "Test" + anchors.fill: parent + id: particles2 + particlesPerSecond: 6000 + particleDuration: 720 + emitting: true + particleSize: 10 + shape: mask + } + TrailEmitter{ + system: sys + particle: "Face" + anchors.fill: parent + id: particles + particlesPerSecond: 60 + particleDuration: 1440 + emitting: true + speed: PointVector{xVariation: 10; yVariation: 10;} + particleSize: 30 + particleSizeVariation: 10 + shape: mask + } + ParticleSystem{ + id: sys + anchors.fill: parent + } + +} diff --git a/examples/declarative/particles/allsmiles/spritestateparticles.qml b/examples/declarative/particles/allsmiles/spritestateparticles.qml new file mode 100644 index 0000000000..6a61487a89 --- /dev/null +++ b/examples/declarative/particles/allsmiles/spritestateparticles.qml @@ -0,0 +1,190 @@ +/**************************************************************************** +** +** 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 Qt.labs.particles 2.0 + +Rectangle{ + color: "goldenrod" + width: 800 + height: 800 + id: root + SpriteImage{ + sprites: [Sprite{ + name: "happy" + source: "content/squarefacesprite2.png" + frames: 6 + duration: 120 + to: {"silly": 0.4, "sad": 0.2, "cyclops":0.1, "boggled":0.3, "dying":0.0} + }, Sprite{ + name: "silly" + source: "content/squarefacesprite.png" + frames: 6 + duration: 120 + to: {"love": 0.4, "happy": 0.1, "evil": 0.2, "cyclops":0.1, "boggled":0.2} + }, Sprite{ + name: "sad" + source: "content/squarefacesprite3.png" + frames: 6 + duration: 120 + to: {"love" : 0.2, "evil": 0.2, "silly": 0.2, "cyclops":0.2, "boggled":0.2} + }, Sprite{ + name: "cyclops" + source: "content/squarefacesprite4.png" + frames: 6 + duration: 120 + to: {"love": 0.1, "evil": 0.1, "silly":0.1, "boggled":0.1, "cyclops" : 1.0} + }, Sprite{ + name: "evil" + source: "content/squarefacesprite5.png" + frames: 6 + duration: 120 + to: {"happy": 1.0} + }, Sprite{ + name: "love" + source: "content/squarefacesprite6.png" + frames: 6 + duration: 120 + to: {"sad": 0.6, "evil":0.4, "boggled":0.2} + }, Sprite{ + name: "boggled" + source: "content/squarefacesprite7.png" + frames: 6 + duration: 120 + to: {"love" : 0.2, "evil": 0.2, "silly": 0.2, "cyclops":0.1, "sad":0.2} + }, Sprite{ + name: "dying" + source: "content/squarefacespriteX.png" + frames: 4 + duration: 120 + to: {"dead":1.0} + }, Sprite{ + name: "dead" + source: "content/squarefacespriteXX.png" + frames: 1 + duration: 10000 + }] + + width: 100 + height: 100 + x: 20 + y: 20 + z:4 + } + ParticleSystem{ id: sys } + SpriteParticle{ + anchors.fill: parent + id: particles + system: sys + sprites: [Sprite{ + name: "happy" + source: "content/squarefacesprite2.png" + frames: 6 + duration: 120 + to: {"silly": 0.4, "sad": 0.2, "cyclops":0.1, "boggled":0.3, "dying":0.0} + }, Sprite{ + name: "silly" + source: "content/squarefacesprite.png" + frames: 6 + duration: 120 + to: {"love": 0.4, "happy": 0.1, "evil": 0.2, "cyclops":0.1, "boggled":0.2} + }, Sprite{ + name: "sad" + source: "content/squarefacesprite3.png" + frames: 6 + duration: 120 + to: {"love" : 0.2, "evil": 0.2, "silly": 0.2, "cyclops":0.2, "boggled":0.2} + }, Sprite{ + name: "cyclops" + source: "content/squarefacesprite4.png" + frames: 6 + duration: 120 + to: {"love": 0.1, "evil": 0.1, "silly":0.1, "boggled":0.1, "cyclops" : 1.0} + }, Sprite{ + name: "evil" + source: "content/squarefacesprite5.png" + frames: 6 + duration: 120 + to: {"happy": 1.0} + }, Sprite{ + name: "love" + source: "content/squarefacesprite6.png" + frames: 6 + duration: 120 + to: {"sad": 0.6, "evil":0.4, "boggled":0.2} + }, Sprite{ + name: "boggled" + source: "content/squarefacesprite7.png" + frames: 6 + duration: 120 + to: {"love" : 0.2, "evil": 0.2, "silly": 0.2, "cyclops":0.1, "sad":0.2} + }, Sprite{ + name: "dying" + source: "content/squarefacespriteX.png" + frames: 4 + duration: 120 + to: {"dead":1.0} + }, Sprite{ + name: "dead" + source: "content/squarefacespriteXX.png" + frames: 1 + duration: 10000 + }] + } + TrailEmitter{ + system: sys + particlesPerSecond: 16 + particleDuration: 10000 + emitting: true + speed: AngleVector{angle: 90; magnitude: 60; angleVariation: 5} + acceleration: PointVector{ y: 10 } + particleSize: 30 + particleSizeVariation: 10 + width: parent.width + height: 100 + } + SpriteGoal{ + system: sys + width: root.width; + height: root.height/2; + y: root.height/2; + goalState:"dead" + } +} diff --git a/examples/declarative/particles/allsmiles/spritevariedparticles.qml b/examples/declarative/particles/allsmiles/spritevariedparticles.qml new file mode 100644 index 0000000000..c1b773093f --- /dev/null +++ b/examples/declarative/particles/allsmiles/spritevariedparticles.qml @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** 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 Qt.labs.particles 2.0 + +Rectangle{ + color: "goldenrod" + width: 800 + height: 800 + ParticleSystem{ id: sys } + SpriteParticle{ + system: sys + anchors.fill: parent + sprites: [Sprite{ + name: "initial" + source: "content/squarefacesprite.png" + frames: 6 + duration: 0 + to: {"happy":0.2, "silly":0.2, "sad":0.2, "cyclops":0.1, "evil":0.1, "love":0.1, "boggled":0.1} + }, Sprite{ + name: "silly" + source: "content/squarefacesprite.png" + frames: 6 + duration: 120 + }, Sprite{ + name: "happy" + source: "content/squarefacesprite2.png" + frames: 6 + duration: 120 + }, Sprite{ + name: "sad" + source: "content/squarefacesprite3.png" + frames: 6 + duration: 120 + }, Sprite{ + name: "cyclops" + source: "content/squarefacesprite4.png" + frames: 6 + duration: 120 + }, Sprite{ + name: "evil" + source: "content/squarefacesprite5.png" + frames: 6 + duration: 120 + }, Sprite{ + name: "love" + source: "content/squarefacesprite6.png" + frames: 6 + duration: 120 + }, Sprite{ + name: "boggled" + source: "content/squarefacesprite7.png" + frames: 6 + duration: 120 + }] + } + TrailEmitter{ + id: particleEmitter + system: sys + width: parent.width + particlesPerSecond: 16 + particleDuration: 8000 + emitting: true + speed: AngleVector{angle: 90; magnitude: 300; magnitudeVariation: 100; angleVariation: 5} + acceleration: PointVector{ y: 10 } + particleSize: 30 + particleSizeVariation: 10 + } + Binding{ + target: particleEmitter + property: "y" + value: ma.mouseY + when: ma.mouseX !=0 || ma.mouseY!=0 + } + MouseArea{ + id: ma + anchors.fill: parent + } +} |