doc: fix some typos in .qml files
[profile/ivi/qtdeclarative.git] / examples / particles / system / system.qml
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the examples of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:BSD$
9 ** You may use this file under the terms of the BSD license as follows:
10 **
11 ** "Redistribution and use in source and binary forms, with or without
12 ** modification, are permitted provided that the following conditions are
13 ** met:
14 **   * Redistributions of source code must retain the above copyright
15 **     notice, this list of conditions and the following disclaimer.
16 **   * Redistributions in binary form must reproduce the above copyright
17 **     notice, this list of conditions and the following disclaimer in
18 **     the documentation and/or other materials provided with the
19 **     distribution.
20 **   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
21 **     the names of its contributors may be used to endorse or promote
22 **     products derived from this software without specific prior written
23 **     permission.
24 **
25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
36 **
37 ** $QT_END_LICENSE$
38 **
39 ****************************************************************************/
40
41 import QtQuick 2.0
42 import "../../shared" as Examples
43
44 /*!
45     \title QtQuick.Particles Examples - Affectors
46     \example particles/system
47     \brief This is a collection of examples using Affectors in the QML particle system.
48     \image qml-system-example.png
49
50     This is a collection of small QML examples relating to using Affectors in the particle system.
51     Each example is a small QML file emphasizing a particular element or feature.
52
53     Dynamic comparison compares using the particle system to getting a similar effect with the following code that dynamically instantiates Image elements.
54     \snippet examples/particles/system/content/dynamiccomparison.qml fake
55     Note how the Image elements are not able to be randomly colorized.
56
57     Start and Stop simply sets the running and paused states of a ParticleSystem. While the system does not perform any simulation when stopped or paused, a restart restarts the simulation from the beginning, while unpausing resumes the simulation from where it was.
58
59     Timed group changes is an example that highlights the ParticleGroup element. While normally referring to groups with a string name is sufficient, additional effects can be
60     done by setting properties on groups.
61     The first group has a variable duration on it, but always transitions to the second group.
62     \snippet examples/particles/system/content/timedgroupchanges.qml 0
63     The second group has a TrailEmitter on it, and a fixed duration for emitting into the third group. By placing the TrailEmitter as a direct child of the ParticleGroup, it automatically selects that group to follow.
64     \snippet examples/particles/system/content/timedgroupchanges.qml 1
65     The third group has an Affector as a direct child, which makes the affector automatically target this group. The affector means that as soon as particles enter this group, a burst function can be called on another emitter, using the x,y positions of this particle.
66     \snippet examples/particles/system/content/timedgroupchanges.qml 2
67
68     If TrailEmitter does not suit your needs for multiple emitters, you can also dynamically create Emitters while still using the same ParticleSystem and image particle
69     \snippet examples/particles/system/content/dynamicemitters.qml 0
70     Note that this effect, a flurry of flying rainbow spears, would be better served with TrailEmitter. It is only done with dynamic emitters in this example to show the concept more simply.
71
72     Multiple Painters shows how to control paint ordering of individual particles. While the paint ordering of particles within one ImagePainter is not strictly defined, ImageParticle elements follow the normal Z-ordering rules for QtQuick items. This example allow you to paint the inside of the particles above the black borders using a pair of ImageParticles each painting different parts of the same logical particle.
73
74 */
75
76 Item {
77     height: 480
78     width: 320
79     Examples.LauncherList {
80         id: ll
81         anchors.fill: parent
82         Component.onCompleted: {
83             addExample("Dynamic Comparison", "Compares with dynamically created elements",  Qt.resolvedUrl("content/dynamiccomparison.qml"));
84             addExample("StartStop", "Start and stop the simulation", Qt.resolvedUrl("content/startstop.qml"));
85             addExample("Timed group changes", "Emit into managed groups",  Qt.resolvedUrl("content/timedgroupchanges.qml"));
86             addExample("Dynamic Emitters", "Dynamically instantiated emitters with a single system",  Qt.resolvedUrl("content/dynamicemitters.qml"));
87             addExample("Multiple Painters", "Several ParticlePainters on the same logical particles",  Qt.resolvedUrl("content/multiplepainters.qml"));
88         }
89     }
90 }