Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qmlvisual / qdeclarativeparticles / particles.qml
1 import QtQuick 1.0
2 import Qt.labs.particles 1.0
3
4 Rectangle {
5     property string skip: "May contain random numbers"
6     width: 640; height: 480; color: "black"
7
8     Particles { id:particlesAneverEmitting
9         y:60; width: 260; height:30; source: "star.png";
10         lifeSpan:1000; count: 50; angle:70; angleDeviation:36;
11         velocity:30; velocityDeviation:10; emissionRate: 0
12         ParticleMotionWander { yvariance:5; xvariance:30; pace:100 }
13     }
14     Particles { id:particlesA //snowy particles from the top
15         y:0; width: 260; height:30; source: "star.png";
16         lifeSpan:1000; count: 50; angle:70; angleDeviation:36;
17         velocity:30; velocityDeviation:10; emissionRate: 10
18         ParticleMotionWander { yvariance:5; xvariance:30; pace:100 }
19     }
20
21     Particles { id:particlesB //particle fountain bursting every second
22         y:280; x:180; width:1; height:1; lifeSpan:1000; source: "star.png"
23         count: 100; angle:270; angleDeviation:45; velocity:50; velocityDeviation:30;
24         emissionRate: 0
25         ParticleMotionGravity { yattractor: 1000; xattractor:0; acceleration:25 }
26     }
27
28     Timer { running: true; interval: 1000; repeat: true; onTriggered: particlesB.burst(200, 2000); }
29
30     Column{
31         x: 340;
32         Repeater{//emission variance test
33             model: 5
34             delegate: Component{
35                 Item{
36                     width: 100; height: 100
37                     Rectangle{
38                         color: "blue"
39                         width: 2; height: 2;
40                         x: 49; y:49;
41                     }
42                     Particles{
43                         x: 50; y:50; width: 0; height: 0;
44                         fadeInDuration: 0; fadeOutDuration: 0
45                         lifeSpan: 1000; lifeSpanDeviation:0;
46                         source: "star.png"
47                         count: -1; emissionRate: 120;
48                         emissionVariance: index/2;
49                         velocity: 250; velocityDeviation: 0;
50                         angle: 0; angleDeviation: 0;
51                     }
52                 }
53             }
54         }
55     }
56 }