]> git.proxmox.com Git - sencha-touch.git/blob - src/examples/particles/app/controller/Main.js
import Sencha Touch 2.4.2 source
[sencha-touch.git] / src / examples / particles / app / controller / Main.js
1 Ext.define("Particles.controller.Main", {
2
3 extend: 'Ext.app.Controller',
4
5 config: {
6
7 refs: {
8 particles: 'particles'
9 },
10
11 control: {
12 'button[action=flame]': {
13 tap: function () {
14 this.getParticles().setConfig({
15 parameters: {
16 velocity: 0,
17 direction: -90,
18 duration: 1000,
19 accelerate: 20,
20 start: {
21 color: 'rgb(255,50,20)',
22 rotation: -90,
23 scale: 80,
24 opacity: 1
25 },
26 end: {
27 color: 'rgb(255,50,20)',
28 rotation: -90,
29 scale: 10,
30 opacity: 0
31 },
32 variance: {
33 velocity: 10,
34 rotation: 360,
35 scale: 10,
36 direction: 9,
37 duration: 800,
38 opacity: 0
39 },
40 x: 0,
41 y: 0
42 },
43 fading: 0,
44 template: {
45 type: 'image',
46 width: 1,
47 height: 1,
48 x: -0.5,
49 y: -0.5,
50 src: 'resources/gold-star.png'
51 },
52 ax: 0,
53 ay: -5
54 });
55 }
56 },
57
58 'button[action=stars]': {
59 tap: function () {
60 this.getParticles().emitter.instances.length = 0;
61 this.getParticles().setConfig({
62 parameters: {
63 velocity: 30,
64 direction: -90,
65 duration: 300,
66 accelerate: 20,
67 start: {
68 color: 'rgb(0,250,20)',
69 rotation: -90,
70 scale: 15,
71 opacity: 1
72 },
73 end: {
74 color: 'rgb(250,250,20)',
75 rotation: -90,
76 scale: 0,
77 opacity: 0
78 },
79 variance: {
80 velocity: 10,
81 rotation: 360,
82 scale: 0,
83 direction: 180,
84 duration: 300,
85 opacity: 0
86 },
87 x: 0,
88 y: 0
89 },
90 fading: 100,
91 template: {
92 type: 'path',
93 path: ['M', 0.3819660112501052, 0, 0.8090169943749475, 0.5877852522924731, 0.11803398874989487, 0.3632712640026805, -0.30901699437494734, 0.9510565162951536, -0.30901699437494745, 0.22451398828979277, -1, 1.2246063538223773e-16, -0.3090169943749475, -0.2245139882897927, -0.30901699437494756, -0.9510565162951535, 0.11803398874989479, -0.3632712640026805, 0.8090169943749473, -0.5877852522924734, 'Z']
94 },
95 ax: 0,
96 ay: 5
97 });
98 }
99 }
100 }
101 }
102 });