@truelab/truengine 4.2.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libs/particles.js +1501 -1503
- package/dist/libs/pixi.js +1 -1
- package/dist/pixi-chunk.js +533 -533
- package/dist/truengine.js +8089 -6568
- package/dist/types/src/classes/assets.class.d.ts +2 -0
- package/dist/types/src/classes/assets.class.d.ts.map +1 -1
- package/dist/types/src/classes/bitmap.text.class.d.ts.map +1 -1
- package/dist/types/src/classes/emitter.class.d.ts.map +1 -1
- package/dist/types/src/classes/sequence.class.d.ts +10 -3
- package/dist/types/src/classes/sequence.class.d.ts.map +1 -1
- package/dist/types/src/classes/spine.assets.class.d.ts +2 -2
- package/dist/types/src/classes/spine.assets.class.d.ts.map +1 -1
- package/dist/types/src/components/animation.catalog.d.ts +6 -2
- package/dist/types/src/components/animation.catalog.d.ts.map +1 -1
- package/dist/types/src/components/bigwin.component.d.ts +1 -0
- package/dist/types/src/components/bigwin.component.d.ts.map +1 -1
- package/dist/types/src/components/cheat.panel.animations.d.ts +18 -2
- package/dist/types/src/components/cheat.panel.animations.d.ts.map +1 -1
- package/dist/types/src/components/cheat.panel.settings.d.ts.map +1 -1
- package/dist/types/src/components/cheat.types.d.ts +8 -1
- package/dist/types/src/components/cheat.types.d.ts.map +1 -1
- package/dist/types/src/components/fly/fly.component.d.ts +113 -0
- package/dist/types/src/components/fly/fly.component.d.ts.map +1 -0
- package/dist/types/src/components/fly/fly.textures.d.ts +7 -0
- package/dist/types/src/components/fly/fly.textures.d.ts.map +1 -0
- package/dist/types/src/components/fly/fly.types.d.ts +165 -0
- package/dist/types/src/components/fly/fly.types.d.ts.map +1 -0
- package/dist/types/src/components/fly/flyers/abstract.flyer.d.ts +32 -0
- package/dist/types/src/components/fly/flyers/abstract.flyer.d.ts.map +1 -0
- package/dist/types/src/components/fly/flyers/comet.flyer.d.ts +46 -0
- package/dist/types/src/components/fly/flyers/comet.flyer.d.ts.map +1 -0
- package/dist/types/src/components/fly/flyers/sprite.flyer.d.ts +24 -0
- package/dist/types/src/components/fly/flyers/sprite.flyer.d.ts.map +1 -0
- package/dist/types/src/components/fly/flyers/value.flyer.d.ts +27 -0
- package/dist/types/src/components/fly/flyers/value.flyer.d.ts.map +1 -0
- package/dist/types/src/components/fpsmeter.component.d.ts +8 -7
- package/dist/types/src/components/fpsmeter.component.d.ts.map +1 -1
- package/dist/types/src/components/slot/frames/frames.spine.component.d.ts +1 -1
- package/dist/types/src/components/slot/frames/frames.spine.component.d.ts.map +1 -1
- package/dist/types/src/components/slot/intrigue/intrigue.blaze.component.d.ts.map +1 -1
- package/dist/types/src/components/slot/intrigue/intrigue.component.d.ts +3 -0
- package/dist/types/src/components/slot/intrigue/intrigue.component.d.ts.map +1 -1
- package/dist/types/src/components/slot/lines/lines.component.d.ts +5 -4
- package/dist/types/src/components/slot/lines/lines.component.d.ts.map +1 -1
- package/dist/types/src/components/slot/lines/lines.static.component.d.ts +123 -4
- package/dist/types/src/components/slot/lines/lines.static.component.d.ts.map +1 -1
- package/dist/types/src/components/slot/payout/payout.base.component.d.ts +34 -5
- package/dist/types/src/components/slot/payout/payout.base.component.d.ts.map +1 -1
- package/dist/types/src/components/slot/payout/payout.component.d.ts +1 -1
- package/dist/types/src/components/slot/reel.component.d.ts +37 -1
- package/dist/types/src/components/slot/reel.component.d.ts.map +1 -1
- package/dist/types/src/components/slot/slot.cheats.d.ts +2 -1
- package/dist/types/src/components/slot/slot.cheats.d.ts.map +1 -1
- package/dist/types/src/components/slot/slot.component.d.ts +26 -11
- package/dist/types/src/components/slot/slot.component.d.ts.map +1 -1
- package/dist/types/src/components/slot/slot.config.d.ts +5 -1
- package/dist/types/src/components/slot/slot.config.d.ts.map +1 -1
- package/dist/types/src/components/slot/symbol/symbol.component.d.ts +5 -1
- package/dist/types/src/components/slot/symbol/symbol.component.d.ts.map +1 -1
- package/dist/types/src/components/slot/symbol/symbol.spine.component.d.ts +7 -11
- package/dist/types/src/components/slot/symbol/symbol.spine.component.d.ts.map +1 -1
- package/dist/types/src/components/slot/symbol/symbol.spine.pool.d.ts +39 -0
- package/dist/types/src/components/slot/symbol/symbol.spine.pool.d.ts.map +1 -0
- package/dist/types/src/components/slot/symbol/symbol.value.spine.component.d.ts +51 -0
- package/dist/types/src/components/slot/symbol/symbol.value.spine.component.d.ts.map +1 -0
- package/dist/types/src/components/slot/value/value.component.d.ts +103 -0
- package/dist/types/src/components/slot/value/value.component.d.ts.map +1 -0
- package/dist/types/src/components/text.component.d.ts.map +1 -1
- package/dist/types/src/extends/events.types.d.ts +1 -0
- package/dist/types/src/extends/events.types.d.ts.map +1 -1
- package/dist/types/src/functions/animate/counter.func.d.ts +1 -1
- package/dist/types/src/functions/animate/counter.func.d.ts.map +1 -1
- package/dist/types/src/functions/cache.funcs.d.ts +1 -1
- package/dist/types/src/functions/draw/radialGradient.func.d.ts +1 -2
- package/dist/types/src/functions/draw/radialGradient.func.d.ts.map +1 -1
- package/dist/types/src/functions/engine.funcs.d.ts +4 -4
- package/dist/types/src/functions/engine.funcs.d.ts.map +1 -1
- package/dist/types/src/functions/speed/duration.func.d.ts +1 -1
- package/dist/types/src/functions/speed/mode.func.d.ts +1 -1
- package/dist/types/src/functions/timeline/create.funcs.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +9 -13
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/scenes/background.scene.d.ts +6 -2
- package/dist/types/src/scenes/background.scene.d.ts.map +1 -1
- package/dist/types/src/services/sounds.howler/sounds.howler.service.d.ts +2 -2
- package/dist/types/src/services/sounds.howler/sounds.howler.service.d.ts.map +1 -1
- package/dist/webworkerAll-chunk.js +1 -1
- package/package.json +1 -1
- package/dist/types/src/classes/color.class.d.ts +0 -73
- package/dist/types/src/classes/color.class.d.ts.map +0 -1
package/dist/libs/particles.js
CHANGED
|
@@ -1,100 +1,203 @@
|
|
|
1
1
|
var pt = Object.defineProperty;
|
|
2
2
|
var ut = (i, t, e) => t in i ? pt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
3
|
var s = (i, t, e) => ut(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { P as mt, T as B, S as dt, b as ft, c as C, d as xt } from "../pixi-chunk.js";
|
|
5
|
+
var p = /* @__PURE__ */ ((i) => (i[i.Spawn = 0] = "Spawn", i[i.Normal = 2] = "Normal", i[i.Late = 5] = "Late", i))(p || {});
|
|
6
|
+
class yt {
|
|
7
|
+
constructor(t) {
|
|
8
|
+
this.particle = t;
|
|
9
|
+
}
|
|
10
|
+
get x() {
|
|
11
|
+
return this.particle.x;
|
|
12
|
+
}
|
|
13
|
+
set x(t) {
|
|
14
|
+
this.particle.x = t;
|
|
15
|
+
}
|
|
16
|
+
get y() {
|
|
17
|
+
return this.particle.y;
|
|
18
|
+
}
|
|
19
|
+
set y(t) {
|
|
20
|
+
this.particle.y = t;
|
|
21
|
+
}
|
|
22
|
+
set(t = 0, e = t) {
|
|
23
|
+
this.particle.x = t, this.particle.y = e;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
class vt {
|
|
27
|
+
constructor(t) {
|
|
28
|
+
this.particle = t;
|
|
29
|
+
}
|
|
30
|
+
get x() {
|
|
31
|
+
return this.particle.scaleX;
|
|
32
|
+
}
|
|
33
|
+
set x(t) {
|
|
34
|
+
this.particle.scaleX = t;
|
|
35
|
+
}
|
|
36
|
+
get y() {
|
|
37
|
+
return this.particle.scaleY;
|
|
38
|
+
}
|
|
39
|
+
set y(t) {
|
|
40
|
+
this.particle.scaleY = t;
|
|
41
|
+
}
|
|
42
|
+
set(t = 0, e = t) {
|
|
43
|
+
this.particle.scaleX = t, this.particle.scaleY = e;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
class Pt {
|
|
47
|
+
constructor(t) {
|
|
48
|
+
this.particle = t;
|
|
49
|
+
}
|
|
50
|
+
get x() {
|
|
51
|
+
return this.particle.anchorX;
|
|
52
|
+
}
|
|
53
|
+
set x(t) {
|
|
54
|
+
this.particle.anchorX = t;
|
|
55
|
+
}
|
|
56
|
+
get y() {
|
|
57
|
+
return this.particle.anchorY;
|
|
58
|
+
}
|
|
59
|
+
set y(t) {
|
|
60
|
+
this.particle.anchorY = t;
|
|
61
|
+
}
|
|
62
|
+
set(t = 0, e = t) {
|
|
63
|
+
this.particle.anchorX = t, this.particle.anchorY = e;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
class _t extends mt {
|
|
6
67
|
/**
|
|
7
|
-
* @param
|
|
68
|
+
* @param emitter The emitter that controls this particle.
|
|
8
69
|
*/
|
|
9
|
-
constructor(
|
|
70
|
+
constructor(e) {
|
|
71
|
+
super({ texture: B.EMPTY, anchorX: 0.5, anchorY: 0.5 });
|
|
10
72
|
/**
|
|
11
|
-
*
|
|
73
|
+
* The emitter that controls this particle.
|
|
12
74
|
*/
|
|
13
|
-
s(this, "
|
|
75
|
+
s(this, "emitter");
|
|
14
76
|
/**
|
|
15
|
-
*
|
|
77
|
+
* The maximum lifetime of this particle, in seconds.
|
|
16
78
|
*/
|
|
17
|
-
s(this, "
|
|
79
|
+
s(this, "maxLife");
|
|
18
80
|
/**
|
|
19
|
-
*
|
|
20
|
-
* Used for weighted random selection of segment.
|
|
81
|
+
* The current age of the particle, in seconds.
|
|
21
82
|
*/
|
|
22
|
-
s(this, "
|
|
23
|
-
|
|
83
|
+
s(this, "age");
|
|
84
|
+
/**
|
|
85
|
+
* The current age of the particle as a normalized value between 0 and 1.
|
|
86
|
+
*/
|
|
87
|
+
s(this, "agePercent");
|
|
88
|
+
/**
|
|
89
|
+
* One divided by the max life of the particle, saved for slightly faster math.
|
|
90
|
+
*/
|
|
91
|
+
s(this, "oneOverLife");
|
|
92
|
+
/**
|
|
93
|
+
* Reference to the next particle in the list.
|
|
94
|
+
*/
|
|
95
|
+
s(this, "next");
|
|
96
|
+
/**
|
|
97
|
+
* Reference to the previous particle in the list.
|
|
98
|
+
*/
|
|
99
|
+
s(this, "prev");
|
|
100
|
+
s(this, "prevChild");
|
|
101
|
+
s(this, "nextChild");
|
|
102
|
+
/**
|
|
103
|
+
* Static per-particle configuration for behaviors to use. Is not cleared when recycling.
|
|
104
|
+
*/
|
|
105
|
+
s(this, "config");
|
|
106
|
+
/** Принимается от BlendModeBehavior, но ParticleContainer рендерит одним блендом — игнорируется */
|
|
107
|
+
s(this, "blendMode");
|
|
108
|
+
/** Флаг видимости для совместимости с эмиттером; рендер частицы им не управляет */
|
|
109
|
+
s(this, "visible");
|
|
110
|
+
/** ParticleContainer не является родителем в терминах сцен-графа — удаление делает эмиттер */
|
|
111
|
+
s(this, "parent", null);
|
|
112
|
+
s(this, "position");
|
|
113
|
+
s(this, "scale");
|
|
114
|
+
s(this, "anchor");
|
|
115
|
+
this.position = new yt(this), this.scale = new vt(this), this.anchor = new Pt(this), this.prevChild = this.nextChild = null, this.emitter = e, this.config = {}, this.visible = !0, this.maxLife = 0, this.age = 0, this.agePercent = 0, this.oneOverLife = 0, this.next = null, this.prev = null;
|
|
24
116
|
}
|
|
25
117
|
/**
|
|
26
|
-
*
|
|
118
|
+
* Initializes the particle for use, based on the properties that have to
|
|
119
|
+
* have been set already on the particle.
|
|
27
120
|
*/
|
|
28
|
-
init(
|
|
29
|
-
|
|
30
|
-
this.segments.push({ p1: { x: 0, y: 0 }, p2: { x: 0, y: 0 }, l: 0 });
|
|
31
|
-
else if (Array.isArray(t[0]))
|
|
32
|
-
for (let e = 0; e < t.length; ++e) {
|
|
33
|
-
const a = t[e];
|
|
34
|
-
let r = a[0];
|
|
35
|
-
for (let l = 1; l < a.length; ++l) {
|
|
36
|
-
const n = a[l];
|
|
37
|
-
this.segments.push({ p1: r, p2: n, l: 0 }), r = n;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
let e = t[0];
|
|
42
|
-
for (let a = 1; a < t.length; ++a) {
|
|
43
|
-
const r = t[a];
|
|
44
|
-
this.segments.push({ p1: e, p2: r, l: 0 }), e = r;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
for (let e = 0; e < this.segments.length; ++e) {
|
|
48
|
-
const { p1: a, p2: r } = this.segments[e], l = Math.sqrt((r.x - a.x) * (r.x - a.x) + (r.y - a.y) * (r.y - a.y));
|
|
49
|
-
this.segments[e].l = l, this.totalLength += l, this.countingLengths.push(this.totalLength);
|
|
50
|
-
}
|
|
121
|
+
init(e) {
|
|
122
|
+
this.maxLife = e, this.age = this.agePercent = 0, this.rotation = 0, this.x = this.y = 0, this.scaleX = this.scaleY = 1, this.tint = 16777215, this.alpha = 1, this.oneOverLife = 1 / this.maxLife, this.visible = !0;
|
|
51
123
|
}
|
|
52
124
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
125
|
+
* Kills the particle, removing it from the display list
|
|
126
|
+
* and telling the emitter to recycle it.
|
|
55
127
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
a = this.segments[o], r = o === 0 ? e : e - this.countingLengths[o - 1];
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
r /= a.l || 1;
|
|
68
|
-
const { p1: l, p2: n } = a;
|
|
69
|
-
t.x = l.x + r * (n.x - l.x), t.y = l.y + r * (n.y - l.y);
|
|
128
|
+
kill() {
|
|
129
|
+
this.emitter.recycle(this);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Destroys the particle, removing references and preventing future use.
|
|
133
|
+
*/
|
|
134
|
+
destroy() {
|
|
135
|
+
this.emitter = this.next = this.prev = null;
|
|
70
136
|
}
|
|
71
137
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
138
|
+
class wt extends dt {
|
|
139
|
+
/**
|
|
140
|
+
* @param emitter The emitter that controls this particle.
|
|
141
|
+
*/
|
|
142
|
+
constructor(e) {
|
|
143
|
+
super();
|
|
75
144
|
/**
|
|
76
|
-
*
|
|
145
|
+
* The emitter that controls this particle.
|
|
77
146
|
*/
|
|
78
|
-
s(this, "
|
|
147
|
+
s(this, "emitter");
|
|
79
148
|
/**
|
|
80
|
-
*
|
|
149
|
+
* The maximum lifetime of this particle, in seconds.
|
|
81
150
|
*/
|
|
82
|
-
s(this, "
|
|
151
|
+
s(this, "maxLife");
|
|
83
152
|
/**
|
|
84
|
-
*
|
|
153
|
+
* The current age of the particle, in seconds.
|
|
85
154
|
*/
|
|
86
|
-
s(this, "
|
|
155
|
+
s(this, "age");
|
|
87
156
|
/**
|
|
88
|
-
*
|
|
157
|
+
* The current age of the particle as a normalized value between 0 and 1.
|
|
89
158
|
*/
|
|
90
|
-
s(this, "
|
|
91
|
-
|
|
159
|
+
s(this, "agePercent");
|
|
160
|
+
/**
|
|
161
|
+
* One divided by the max life of the particle, saved for slightly faster math.
|
|
162
|
+
*/
|
|
163
|
+
s(this, "oneOverLife");
|
|
164
|
+
/**
|
|
165
|
+
* Reference to the next particle in the list.
|
|
166
|
+
*/
|
|
167
|
+
s(this, "next");
|
|
168
|
+
/**
|
|
169
|
+
* Reference to the previous particle in the list.
|
|
170
|
+
*/
|
|
171
|
+
s(this, "prev");
|
|
172
|
+
s(this, "prevChild");
|
|
173
|
+
s(this, "nextChild");
|
|
174
|
+
/**
|
|
175
|
+
* Static per-particle configuration for behaviors to use. Is not cleared when recycling.
|
|
176
|
+
*/
|
|
177
|
+
s(this, "config");
|
|
178
|
+
this.prevChild = this.nextChild = null, this.emitter = e, this.config = {}, this.anchor.x = this.anchor.y = 0.5, this.maxLife = 0, this.age = 0, this.agePercent = 0, this.oneOverLife = 0, this.next = null, this.prev = null, this.init = this.init, this.kill = this.kill;
|
|
92
179
|
}
|
|
93
|
-
|
|
94
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Initializes the particle for use, based on the properties that have to
|
|
182
|
+
* have been set already on the particle.
|
|
183
|
+
*/
|
|
184
|
+
init(e) {
|
|
185
|
+
this.maxLife = e, this.age = this.agePercent = 0, this.rotation = 0, this.position.x = this.position.y = 0, this.scale.x = this.scale.y = 1, this.tint = 16777215, this.alpha = 1, this.oneOverLife = 1 / this.maxLife, this.visible = !0;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Kills the particle, removing it from the display list
|
|
189
|
+
* and telling the emitter to recycle it.
|
|
190
|
+
*/
|
|
191
|
+
kill() {
|
|
192
|
+
this.emitter.recycle(this);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Destroys the particle, removing references and preventing future use.
|
|
196
|
+
*/
|
|
197
|
+
destroy() {
|
|
198
|
+
this.parent && this.parent.removeChild(this), this.emitter = this.next = this.prev = null, super.destroy();
|
|
95
199
|
}
|
|
96
200
|
}
|
|
97
|
-
s(A, "type", "rect"), s(A, "editorConfig", null);
|
|
98
201
|
class P {
|
|
99
202
|
/**
|
|
100
203
|
* @param value The value for this node
|
|
@@ -153,7 +256,7 @@ class P {
|
|
|
153
256
|
}
|
|
154
257
|
}
|
|
155
258
|
let F = B.from;
|
|
156
|
-
const
|
|
259
|
+
const gt = !1, _ = Math.PI / 180;
|
|
157
260
|
function w(i, t) {
|
|
158
261
|
if (!i) return;
|
|
159
262
|
const e = Math.sin(i), a = Math.cos(i), r = t.x * a - t.y * e, l = t.x * e + t.y * a;
|
|
@@ -190,7 +293,7 @@ function nt(i) {
|
|
|
190
293
|
function ot(i) {
|
|
191
294
|
return i ? i.toLowerCase().replace(/_/g, "-").replace(/ /g, "-") : "normal";
|
|
192
295
|
}
|
|
193
|
-
function
|
|
296
|
+
function Ct(i, t = 10) {
|
|
194
297
|
(typeof t != "number" || t <= 0) && (t = 10);
|
|
195
298
|
const e = new P(g(i[0].value), i[0].time);
|
|
196
299
|
e.isStepped = !0;
|
|
@@ -214,7 +317,7 @@ const It = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
214
317
|
DEG_TO_RADS: _,
|
|
215
318
|
GetTextureFromString: F,
|
|
216
319
|
combineRGBComponents: k,
|
|
217
|
-
createSteppedGradient:
|
|
320
|
+
createSteppedGradient: Ct,
|
|
218
321
|
generateEase: nt,
|
|
219
322
|
getBlendMode: ot,
|
|
220
323
|
hexToRGB: g,
|
|
@@ -222,1562 +325,1457 @@ const It = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
222
325
|
normalize: lt,
|
|
223
326
|
rotatePoint: w,
|
|
224
327
|
scaleBy: rt,
|
|
225
|
-
verbose:
|
|
226
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
227
|
-
|
|
228
|
-
|
|
328
|
+
verbose: gt
|
|
329
|
+
}, Symbol.toStringTag, { value: "Module" })), st = ft.shared, b = Symbol("Position particle per emitter position"), L = class L {
|
|
330
|
+
/**
|
|
331
|
+
* @param particleParent The container to add the particles to.
|
|
332
|
+
* @param particleImages A texture or array of textures to use
|
|
333
|
+
* for the particles. Strings will be turned
|
|
334
|
+
* into textures via Texture.from().
|
|
335
|
+
* @param config A configuration object containing settings for the emitter.
|
|
336
|
+
* @param config.emit If config.emit is explicitly passed as false, the
|
|
337
|
+
* Emitter will start disabled.
|
|
338
|
+
* @param config.autoUpdate If config.autoUpdate is explicitly passed as
|
|
339
|
+
* true, the Emitter will automatically call
|
|
340
|
+
* update via the PIXI shared ticker.
|
|
341
|
+
*/
|
|
342
|
+
constructor(t, e) {
|
|
229
343
|
/**
|
|
230
|
-
*
|
|
344
|
+
* Active initialization behaviors for this emitter.
|
|
231
345
|
*/
|
|
232
|
-
s(this, "
|
|
346
|
+
s(this, "initBehaviors");
|
|
233
347
|
/**
|
|
234
|
-
*
|
|
348
|
+
* Active update behaviors for this emitter.
|
|
235
349
|
*/
|
|
236
|
-
s(this, "
|
|
350
|
+
s(this, "updateBehaviors");
|
|
237
351
|
/**
|
|
238
|
-
*
|
|
352
|
+
* Active recycle behaviors for this emitter.
|
|
239
353
|
*/
|
|
240
|
-
s(this, "
|
|
354
|
+
s(this, "recycleBehaviors");
|
|
355
|
+
// properties for individual particles
|
|
241
356
|
/**
|
|
242
|
-
*
|
|
357
|
+
* The minimum lifetime for a particle, in seconds.
|
|
243
358
|
*/
|
|
244
|
-
s(this, "
|
|
359
|
+
s(this, "minLifetime");
|
|
245
360
|
/**
|
|
246
|
-
*
|
|
361
|
+
* The maximum lifetime for a particle, in seconds.
|
|
362
|
+
*/
|
|
363
|
+
s(this, "maxLifetime");
|
|
364
|
+
/**
|
|
365
|
+
* An easing function for nonlinear interpolation of values. Accepts a single
|
|
366
|
+
* parameter of time as a value from 0-1, inclusive. Expected outputs are values
|
|
367
|
+
* from 0-1, inclusive.
|
|
368
|
+
*/
|
|
369
|
+
s(this, "customEase");
|
|
370
|
+
// properties for spawning particles
|
|
371
|
+
/**
|
|
372
|
+
* Time between particle spawns in seconds.
|
|
373
|
+
*/
|
|
374
|
+
s(this, "_frequency");
|
|
375
|
+
/**
|
|
376
|
+
* Chance that a particle will be spawned on each opportunity to spawn one.
|
|
377
|
+
* 0 is 0%, 1 is 100%.
|
|
378
|
+
*/
|
|
379
|
+
s(this, "spawnChance");
|
|
380
|
+
/**
|
|
381
|
+
* Maximum number of particles to keep alive at a time. If this limit
|
|
382
|
+
* is reached, no more particles will spawn until some have died.
|
|
383
|
+
*/
|
|
384
|
+
s(this, "maxParticles");
|
|
385
|
+
/**
|
|
386
|
+
* The amount of time in seconds to emit for before setting emit to false.
|
|
387
|
+
* A value of -1 is an unlimited amount of time.
|
|
388
|
+
*/
|
|
389
|
+
s(this, "emitterLifetime");
|
|
390
|
+
/**
|
|
391
|
+
* Position at which to spawn particles, relative to the emitter's owner's origin.
|
|
392
|
+
* For example, the flames of a rocket travelling right might have a spawnPos
|
|
393
|
+
* of {x:-50, y:0}.
|
|
394
|
+
* to spawn at the rear of the rocket.
|
|
395
|
+
* To change this, use updateSpawnPos().
|
|
396
|
+
*/
|
|
397
|
+
s(this, "spawnPos");
|
|
398
|
+
/**
|
|
399
|
+
* Number of particles to spawn time that the frequency allows for particles to spawn.
|
|
400
|
+
*/
|
|
401
|
+
s(this, "particlesPerWave");
|
|
402
|
+
/**
|
|
403
|
+
* Rotation of the emitter or emitter's owner in degrees. This is added to
|
|
404
|
+
* the calculated spawn angle.
|
|
405
|
+
* To change this, use rotate().
|
|
247
406
|
*/
|
|
248
407
|
s(this, "rotation");
|
|
249
|
-
this.x = t.x || 0, this.y = t.y || 0, this.radius = t.radius, this.innerRadius = t.innerRadius || 0, this.rotation = !!t.affectRotation;
|
|
250
|
-
}
|
|
251
|
-
getRandPos(t) {
|
|
252
|
-
this.innerRadius !== this.radius ? t.x = Math.random() * (this.radius - this.innerRadius) + this.innerRadius : t.x = this.radius, t.y = 0;
|
|
253
|
-
const e = Math.random() * Math.PI * 2;
|
|
254
|
-
this.rotation && (t.rotation += e), w(e, t.position), t.position.x += this.x, t.position.y += this.y;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
s(T, "type", "torus"), s(T, "editorConfig", null);
|
|
258
|
-
const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
259
|
-
__proto__: null,
|
|
260
|
-
PolygonalChain: O,
|
|
261
|
-
Rectangle: A,
|
|
262
|
-
Torus: T
|
|
263
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
264
|
-
var p = /* @__PURE__ */ ((i) => (i[i.Spawn = 0] = "Spawn", i[i.Normal = 2] = "Normal", i[i.Late = 5] = "Late", i))(p || {});
|
|
265
|
-
const _t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
266
|
-
__proto__: null
|
|
267
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
268
|
-
class I {
|
|
269
|
-
constructor(t) {
|
|
270
|
-
// doesn't _really_ need to be late, but doing so ensures that we can override any
|
|
271
|
-
// rotation behavior that is mistakenly added
|
|
272
|
-
s(this, "order", p.Late);
|
|
273
|
-
s(this, "minStart");
|
|
274
|
-
s(this, "maxStart");
|
|
275
|
-
s(this, "accel");
|
|
276
|
-
s(this, "rotate");
|
|
277
|
-
s(this, "maxSpeed");
|
|
278
|
-
this.minStart = t.minStart, this.maxStart = t.maxStart, this.accel = t.accel, this.rotate = !!t.rotate, this.maxSpeed = t.maxSpeed ?? 0;
|
|
279
|
-
}
|
|
280
|
-
initParticles(t) {
|
|
281
|
-
let e = t;
|
|
282
|
-
for (; e; ) {
|
|
283
|
-
const a = Math.random() * (this.maxStart - this.minStart) + this.minStart;
|
|
284
|
-
e.config.velocity ? e.config.velocity.set(a, 0) : e.config.velocity = new C(a, 0), w(e.rotation, e.config.velocity), e = e.next;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
updateParticle(t, e) {
|
|
288
|
-
const a = t.config.velocity, r = a.x, l = a.y;
|
|
289
|
-
if (a.x += this.accel.x * e, a.y += this.accel.y * e, this.maxSpeed) {
|
|
290
|
-
const n = at(a);
|
|
291
|
-
n > this.maxSpeed && rt(a, this.maxSpeed / n);
|
|
292
|
-
}
|
|
293
|
-
t.x += (r + a.x) / 2 * e, t.y += (l + a.y) / 2 * e, this.rotate && (t.rotation = Math.atan2(a.y, a.x));
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
s(I, "type", "moveAcceleration"), s(I, "editorConfig", null);
|
|
297
|
-
function wt(i) {
|
|
298
|
-
return this.ease && (i = this.ease(i)), (this.first.next.value - this.first.value) * i + this.first.value;
|
|
299
|
-
}
|
|
300
|
-
function gt(i) {
|
|
301
|
-
this.ease && (i = this.ease(i));
|
|
302
|
-
const t = this.first.value, e = this.first.next.value, a = (e.r - t.r) * i + t.r, r = (e.g - t.g) * i + t.g, l = (e.b - t.b) * i + t.b;
|
|
303
|
-
return k(a, r, l);
|
|
304
|
-
}
|
|
305
|
-
function Ct(i) {
|
|
306
|
-
this.ease && (i = this.ease(i));
|
|
307
|
-
let t = this.first, { next: e } = t;
|
|
308
|
-
for (; i > e.time; )
|
|
309
|
-
t = e, e = e.next;
|
|
310
|
-
return i = (i - t.time) / (e.time - t.time), (e.value - t.value) * i + t.value;
|
|
311
|
-
}
|
|
312
|
-
function St(i) {
|
|
313
|
-
this.ease && (i = this.ease(i));
|
|
314
|
-
let t = this.first, { next: e } = t;
|
|
315
|
-
for (; i > e.time; )
|
|
316
|
-
t = e, e = e.next;
|
|
317
|
-
i = (i - t.time) / (e.time - t.time);
|
|
318
|
-
const a = t.value, r = e.value, l = (r.r - a.r) * i + a.r, n = (r.g - a.g) * i + a.g, o = (r.b - a.b) * i + a.b;
|
|
319
|
-
return k(l, n, o);
|
|
320
|
-
}
|
|
321
|
-
function bt(i) {
|
|
322
|
-
this.ease && (i = this.ease(i));
|
|
323
|
-
let t = this.first;
|
|
324
|
-
for (; t.next && i > t.next.time; )
|
|
325
|
-
t = t.next;
|
|
326
|
-
return t.value;
|
|
327
|
-
}
|
|
328
|
-
function Lt(i) {
|
|
329
|
-
this.ease && (i = this.ease(i));
|
|
330
|
-
let t = this.first;
|
|
331
|
-
for (; t.next && i > t.next.time; )
|
|
332
|
-
t = t.next;
|
|
333
|
-
const e = t.value;
|
|
334
|
-
return k(e.r, e.g, e.b);
|
|
335
|
-
}
|
|
336
|
-
class R {
|
|
337
|
-
/**
|
|
338
|
-
* @param isColor If this list handles color values
|
|
339
|
-
*/
|
|
340
|
-
constructor(t = !1) {
|
|
341
408
|
/**
|
|
342
|
-
* The
|
|
409
|
+
* The world position of the emitter's owner, to add spawnPos to when
|
|
410
|
+
* spawning particles. To change this, use updateOwnerPos().
|
|
343
411
|
*/
|
|
344
|
-
s(this, "
|
|
412
|
+
s(this, "ownerPos");
|
|
345
413
|
/**
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
* @param lerp The interpolation value from 0-1.
|
|
349
|
-
* @return The interpolated value. Colors are converted to the hex value.
|
|
414
|
+
* The origin + spawnPos in the previous update, so that the spawn position
|
|
415
|
+
* can be interpolated to space out particles better.
|
|
350
416
|
*/
|
|
351
|
-
s(this, "
|
|
417
|
+
s(this, "_prevEmitterPos");
|
|
352
418
|
/**
|
|
353
|
-
*
|
|
354
|
-
* @param lerp The interpolation value from 0-1.
|
|
355
|
-
* @return The eased value, also from 0-1.
|
|
419
|
+
* If _prevEmitterPos is valid, to prevent interpolation on the first update
|
|
356
420
|
*/
|
|
357
|
-
s(this, "
|
|
421
|
+
s(this, "_prevPosIsValid");
|
|
358
422
|
/**
|
|
359
|
-
* If
|
|
423
|
+
* If either ownerPos or spawnPos has changed since the previous update.
|
|
360
424
|
*/
|
|
361
|
-
s(this, "
|
|
362
|
-
|
|
425
|
+
s(this, "_posChanged");
|
|
426
|
+
/**
|
|
427
|
+
* The container to add particles to.
|
|
428
|
+
*/
|
|
429
|
+
s(this, "_parent");
|
|
430
|
+
/**
|
|
431
|
+
* If particles should be added at the back of the display list instead of the front.
|
|
432
|
+
*/
|
|
433
|
+
s(this, "addAtBack");
|
|
434
|
+
/**
|
|
435
|
+
* The current number of active particles.
|
|
436
|
+
*/
|
|
437
|
+
s(this, "particleCount");
|
|
438
|
+
/**
|
|
439
|
+
* If particles should be emitted during update() calls. Setting this to false
|
|
440
|
+
* stops new particles from being created, but allows existing ones to die out.
|
|
441
|
+
*/
|
|
442
|
+
s(this, "_emit");
|
|
443
|
+
/**
|
|
444
|
+
* The timer for when to spawn particles in seconds, where numbers less
|
|
445
|
+
* than 0 mean that particles should be spawned.
|
|
446
|
+
*/
|
|
447
|
+
s(this, "_spawnTimer");
|
|
448
|
+
/**
|
|
449
|
+
* The life of the emitter in seconds.
|
|
450
|
+
*/
|
|
451
|
+
s(this, "_emitterLife");
|
|
452
|
+
/**
|
|
453
|
+
* The particles that are active and on the display list. This is the first particle in a
|
|
454
|
+
* linked list.
|
|
455
|
+
*/
|
|
456
|
+
s(this, "_activeParticlesFirst");
|
|
457
|
+
/**
|
|
458
|
+
* The particles that are active and on the display list. This is the last particle in a
|
|
459
|
+
* linked list.
|
|
460
|
+
*/
|
|
461
|
+
s(this, "_activeParticlesLast");
|
|
462
|
+
/**
|
|
463
|
+
* The particles that are not currently being used. This is the first particle in a
|
|
464
|
+
* linked list.
|
|
465
|
+
*/
|
|
466
|
+
s(this, "_poolFirst");
|
|
467
|
+
/**
|
|
468
|
+
* The original config object that this emitter was initialized with.
|
|
469
|
+
*/
|
|
470
|
+
s(this, "_origConfig");
|
|
471
|
+
/**
|
|
472
|
+
* If the update function is called automatically from the shared ticker.
|
|
473
|
+
* Setting this to false requires calling the update function manually.
|
|
474
|
+
*/
|
|
475
|
+
s(this, "_autoUpdate");
|
|
476
|
+
/**
|
|
477
|
+
* Родитель является PIXI.ParticleContainer (частицы добавляются через addParticle)
|
|
478
|
+
*/
|
|
479
|
+
s(this, "_isParticleContainer");
|
|
480
|
+
/**
|
|
481
|
+
* If the emitter should destroy itself when all particles have died out. This is set by
|
|
482
|
+
* playOnceAndDestroy();
|
|
483
|
+
*/
|
|
484
|
+
s(this, "_destroyWhenComplete");
|
|
485
|
+
/**
|
|
486
|
+
* A callback for when all particles have died out. This is set by
|
|
487
|
+
* playOnceAndDestroy() or playOnce();
|
|
488
|
+
*/
|
|
489
|
+
s(this, "_completeCallback");
|
|
490
|
+
this.initBehaviors = [], this.updateBehaviors = [], this.recycleBehaviors = [], this.minLifetime = 0, this.maxLifetime = 0, this.customEase = null, this._frequency = 1, this.spawnChance = 1, this.maxParticles = 1e3, this.emitterLifetime = -1, this.spawnPos = new C(), this.particlesPerWave = 1, this.rotation = 0, this.ownerPos = new C(), this._prevEmitterPos = new C(), this._prevPosIsValid = !1, this._posChanged = !1, this._parent = null, this._isParticleContainer = !1, this.addAtBack = !1, this.particleCount = 0, this._emit = !1, this._spawnTimer = 0, this._emitterLife = -1, this._activeParticlesFirst = null, this._activeParticlesLast = null, this._poolFirst = null, this._origConfig = null, this._autoUpdate = !1, this._destroyWhenComplete = !1, this._completeCallback = null, this.parent = t, e && this.init(e), this.recycle = this.recycle, this.update = this.update, this.rotate = this.rotate, this.updateSpawnPos = this.updateSpawnPos, this.updateOwnerPos = this.updateOwnerPos;
|
|
363
491
|
}
|
|
364
492
|
/**
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
*
|
|
493
|
+
* Registers a new behavior, so that it will be recognized when initializing emitters.
|
|
494
|
+
* Behaviors registered later with duplicate types will override older ones, although there is no limit on
|
|
495
|
+
* the allowed types.
|
|
496
|
+
* @param constructor The behavior class to register.
|
|
368
497
|
*/
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
class V {
|
|
374
|
-
constructor(t) {
|
|
375
|
-
s(this, "order", p.Normal);
|
|
376
|
-
s(this, "list");
|
|
377
|
-
this.list = new R(!1), this.list.reset(P.createList(t.alpha));
|
|
498
|
+
static registerBehavior(t) {
|
|
499
|
+
L.knownBehaviors[t.type] = t;
|
|
378
500
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
501
|
+
/**
|
|
502
|
+
* Time between particle spawns in seconds. If this value is not a number greater than 0,
|
|
503
|
+
* it will be set to 1 (particle per second) to prevent infinite loops.
|
|
504
|
+
*/
|
|
505
|
+
get frequency() {
|
|
506
|
+
return this._frequency;
|
|
383
507
|
}
|
|
384
|
-
|
|
385
|
-
t.
|
|
508
|
+
set frequency(t) {
|
|
509
|
+
typeof t == "number" && t > 0 ? this._frequency = t : this._frequency = 1;
|
|
386
510
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
s(this, "value");
|
|
393
|
-
this.value = t.alpha;
|
|
394
|
-
}
|
|
395
|
-
initParticles(t) {
|
|
396
|
-
let e = t;
|
|
397
|
-
for (; e; )
|
|
398
|
-
e.alpha = this.value, e = e.next;
|
|
511
|
+
/**
|
|
512
|
+
* The container to add particles to. Settings this will dump any active particles.
|
|
513
|
+
*/
|
|
514
|
+
get parent() {
|
|
515
|
+
return this._parent;
|
|
399
516
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
for (let e = 0; e < i.length; ++e) {
|
|
405
|
-
let a = i[e];
|
|
406
|
-
if (typeof a == "string")
|
|
407
|
-
t.push(F(a));
|
|
408
|
-
else if (a instanceof B)
|
|
409
|
-
t.push(a);
|
|
410
|
-
else {
|
|
411
|
-
let r = a.count || 1;
|
|
412
|
-
for (typeof a.texture == "string" ? a = F(a.texture) : a = a.texture; r > 0; --r)
|
|
413
|
-
t.push(a);
|
|
414
|
-
}
|
|
517
|
+
set parent(t) {
|
|
518
|
+
this.cleanup();
|
|
519
|
+
const e = t instanceof xt;
|
|
520
|
+
e !== this._isParticleContainer && (this._poolFirst = null), this._isParticleContainer = e, this._parent = t;
|
|
415
521
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
s(this, "anims");
|
|
422
|
-
this.anims = [];
|
|
423
|
-
for (let e = 0; e < t.anims.length; ++e) {
|
|
424
|
-
const a = t.anims[e], r = ht(a.textures), l = a.framerate < 0 ? -1 : a.framerate > 0 ? a.framerate : 60, n = {
|
|
425
|
-
textures: r,
|
|
426
|
-
duration: l > 0 ? r.length / l : 0,
|
|
427
|
-
framerate: l,
|
|
428
|
-
loop: l > 0 ? !!a.loop : !1
|
|
429
|
-
};
|
|
430
|
-
this.anims.push(n);
|
|
431
|
-
}
|
|
522
|
+
/**
|
|
523
|
+
* Создать частицу подходящего класса: лёгкую для ParticleContainer или спрайтовую для обычного контейнера
|
|
524
|
+
*/
|
|
525
|
+
_createParticle() {
|
|
526
|
+
return this._isParticleContainer ? new _t(this) : new wt(this);
|
|
432
527
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
}
|
|
528
|
+
/**
|
|
529
|
+
* Добавить частицу в контейнер (addParticle для ParticleContainer, addChild для обычного)
|
|
530
|
+
*/
|
|
531
|
+
_addParticleToParent(t) {
|
|
532
|
+
this._isParticleContainer ? this._parent.addParticle(t) : this.addAtBack ? this._parent.addChildAt(t, 0) : this._parent.addChild(t);
|
|
439
533
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
534
|
+
/**
|
|
535
|
+
* Sets up the emitter based on the config settings.
|
|
536
|
+
* @param config A configuration object containing settings for the emitter.
|
|
537
|
+
*/
|
|
538
|
+
init(t) {
|
|
539
|
+
if (!t)
|
|
540
|
+
return;
|
|
541
|
+
this.cleanup(), this._origConfig = t, this.minLifetime = t.lifetime.min, this.maxLifetime = t.lifetime.max, t.ease ? this.customEase = typeof t.ease == "function" ? t.ease : nt(t.ease) : this.customEase = null, this.particlesPerWave = 1, t.particlesPerWave && t.particlesPerWave > 1 && (this.particlesPerWave = t.particlesPerWave), this.frequency = t.frequency, this.spawnChance = typeof t.spawnChance == "number" && t.spawnChance > 0 ? t.spawnChance : 1, this.emitterLifetime = t.emitterLifetime || -1, this.maxParticles = t.maxParticles > 0 ? t.maxParticles : 1e3, this.addAtBack = !!t.addAtBack, this.rotation = 0, this.ownerPos.set(0), t.pos ? this.spawnPos.copyFrom(t.pos) : this.spawnPos.set(0), this._prevEmitterPos.copyFrom(this.spawnPos), this._prevPosIsValid = !1, this._spawnTimer = 0, this.emit = t.emit === void 0 ? !0 : !!t.emit, this.autoUpdate = !!t.autoUpdate;
|
|
542
|
+
const e = t.behaviors.map((a) => {
|
|
543
|
+
const r = L.knownBehaviors[a.type];
|
|
544
|
+
return r ? new r(a.config) : (console.error(`Unknown behavior: ${a.type}`), null);
|
|
545
|
+
}).filter((a) => !!a);
|
|
546
|
+
e.push(b), e.sort((a, r) => a === b ? r.order === p.Spawn ? 1 : -1 : r === b ? a.order === p.Spawn ? -1 : 1 : a.order - r.order), this.initBehaviors = e.slice(), this.updateBehaviors = e.filter((a) => a !== b && a.updateParticle), this.recycleBehaviors = e.filter(
|
|
547
|
+
(a) => a !== b && a.recycleParticle
|
|
548
|
+
);
|
|
445
549
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
const { anim: e } = t, a = ht(e.textures), r = e.framerate < 0 ? -1 : e.framerate > 0 ? e.framerate : 60;
|
|
453
|
-
this.anim = {
|
|
454
|
-
textures: a,
|
|
455
|
-
duration: r > 0 ? a.length / r : 0,
|
|
456
|
-
framerate: r,
|
|
457
|
-
loop: r > 0 ? !!e.loop : !1
|
|
458
|
-
};
|
|
550
|
+
/**
|
|
551
|
+
* Gets the instantiated behavior of the specified type, if it is present on this emitter.
|
|
552
|
+
* @param type The behavior type to find.
|
|
553
|
+
*/
|
|
554
|
+
getBehavior(t) {
|
|
555
|
+
return L.knownBehaviors[t] && this.initBehaviors.find((e) => e instanceof L.knownBehaviors[t]) || null;
|
|
459
556
|
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
557
|
+
/**
|
|
558
|
+
* Fills the pool with the specified number of particles, so that they don't have to be instantiated later.
|
|
559
|
+
* @param count The number of particles to create.
|
|
560
|
+
*/
|
|
561
|
+
fillPool(t) {
|
|
562
|
+
for (; t > 0; --t) {
|
|
563
|
+
const e = this._createParticle();
|
|
564
|
+
e.next = this._poolFirst, this._poolFirst = e;
|
|
565
|
+
}
|
|
465
566
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
567
|
+
/**
|
|
568
|
+
* Recycles an individual particle. For internal use only.
|
|
569
|
+
* @param particle The particle to recycle.
|
|
570
|
+
* @param fromCleanup If this is being called to manually clean up all particles.
|
|
571
|
+
* @internal
|
|
572
|
+
*/
|
|
573
|
+
recycle(t, e = !1) {
|
|
574
|
+
var a;
|
|
575
|
+
for (let r = 0; r < this.recycleBehaviors.length; ++r)
|
|
576
|
+
this.recycleBehaviors[r].recycleParticle(t, !e);
|
|
577
|
+
t.next && (t.next.prev = t.prev), t.prev && (t.prev.next = t.next), t === this._activeParticlesLast && (this._activeParticlesLast = t.prev), t === this._activeParticlesFirst && (this._activeParticlesFirst = t.next), t.prev = null, t.next = this._poolFirst, this._poolFirst = t, this._isParticleContainer ? (a = this._parent) == null || a.removeParticle(t) : t.parent && t.parent.removeChild(t), --this.particleCount;
|
|
471
578
|
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
this.
|
|
579
|
+
/**
|
|
580
|
+
* Sets the rotation of the emitter to a new value. This rotates the spawn position in addition
|
|
581
|
+
* to particle direction.
|
|
582
|
+
* @param newRot The new rotation, in degrees.
|
|
583
|
+
*/
|
|
584
|
+
rotate(t) {
|
|
585
|
+
if (this.rotation === t) return;
|
|
586
|
+
const e = t - this.rotation;
|
|
587
|
+
this.rotation = t, w(e, this.spawnPos), this._posChanged = !0;
|
|
479
588
|
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
589
|
+
/**
|
|
590
|
+
* Changes the spawn position of the emitter.
|
|
591
|
+
* @param x The new x value of the spawn position for the emitter.
|
|
592
|
+
* @param y The new y value of the spawn position for the emitter.
|
|
593
|
+
*/
|
|
594
|
+
updateSpawnPos(t, e) {
|
|
595
|
+
this._posChanged = !0, this.spawnPos.x = t, this.spawnPos.y = e;
|
|
484
596
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
this.spacing = t.spacing * _, this.start = t.start * _, this.distance = t.distance;
|
|
597
|
+
/**
|
|
598
|
+
* Changes the position of the emitter's owner. You should call this if you are adding
|
|
599
|
+
* particles to the world container that your emitter's owner is moving around in.
|
|
600
|
+
* @param x The new x value of the emitter's owner.
|
|
601
|
+
* @param y The new y value of the emitter's owner.
|
|
602
|
+
*/
|
|
603
|
+
updateOwnerPos(t, e) {
|
|
604
|
+
this._posChanged = !0, this.ownerPos.x = t, this.ownerPos.y = e;
|
|
494
605
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
606
|
+
/**
|
|
607
|
+
* Prevents emitter position interpolation in the next update.
|
|
608
|
+
* This should be used if you made a major position change of your emitter's owner
|
|
609
|
+
* that was not normal movement.
|
|
610
|
+
*/
|
|
611
|
+
resetPositionTracking() {
|
|
612
|
+
this._prevPosIsValid = !1;
|
|
501
613
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
this.list = new R(!0), this.list.reset(P.createList(t.color));
|
|
614
|
+
/**
|
|
615
|
+
* If particles should be emitted during update() calls. Setting this to false
|
|
616
|
+
* stops new particles from being created, but allows existing ones to die out.
|
|
617
|
+
*/
|
|
618
|
+
get emit() {
|
|
619
|
+
return this._emit;
|
|
509
620
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
const a = this.list.first.value, r = k(a.r, a.g, a.b);
|
|
513
|
-
for (; e; )
|
|
514
|
-
e.tint = r, e = e.next;
|
|
621
|
+
set emit(t) {
|
|
622
|
+
this._emit = !!t, this._emitterLife = this.emitterLifetime;
|
|
515
623
|
}
|
|
516
|
-
|
|
517
|
-
|
|
624
|
+
/**
|
|
625
|
+
* If the update function is called automatically from the shared ticker.
|
|
626
|
+
* Setting this to false requires calling the update function manually.
|
|
627
|
+
*/
|
|
628
|
+
get autoUpdate() {
|
|
629
|
+
return this._autoUpdate;
|
|
518
630
|
}
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
class X {
|
|
522
|
-
constructor(t) {
|
|
523
|
-
s(this, "order", p.Normal);
|
|
524
|
-
s(this, "value");
|
|
525
|
-
let { color: e } = t;
|
|
526
|
-
e.charAt(0) === "#" ? e = e.substr(1) : e.indexOf("0x") === 0 && (e = e.substr(2)), this.value = parseInt(e, 16);
|
|
631
|
+
set autoUpdate(t) {
|
|
632
|
+
this._autoUpdate && !t ? st.remove(this.update, this) : !this._autoUpdate && t && st.add(this.update, this), this._autoUpdate = !!t;
|
|
527
633
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
634
|
+
/**
|
|
635
|
+
* Starts emitting particles, sets autoUpdate to true, and sets up the Emitter to destroy itself
|
|
636
|
+
* when particle emission is complete.
|
|
637
|
+
* @param callback Callback for when emission is complete (all particles have died off)
|
|
638
|
+
*/
|
|
639
|
+
playOnceAndDestroy(t) {
|
|
640
|
+
this.autoUpdate = !0, this.emit = !0, this._destroyWhenComplete = !0, this._completeCallback = t;
|
|
532
641
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
s(this, "index");
|
|
540
|
-
this.index = 0, this.textures = t.textures.map((e) => typeof e == "string" ? F(e) : e);
|
|
642
|
+
/**
|
|
643
|
+
* Starts emitting particles and optionally calls a callback when particle emission is complete.
|
|
644
|
+
* @param callback Callback for when emission is complete (all particles have died off)
|
|
645
|
+
*/
|
|
646
|
+
playOnce(t) {
|
|
647
|
+
this.emit = !0, this._completeCallback = t;
|
|
541
648
|
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
"cos",
|
|
569
|
-
"cosh",
|
|
570
|
-
"exp",
|
|
571
|
-
"expm1",
|
|
572
|
-
"floor",
|
|
573
|
-
"fround",
|
|
574
|
-
"hypot",
|
|
575
|
-
"log",
|
|
576
|
-
"log1p",
|
|
577
|
-
"log10",
|
|
578
|
-
"log2",
|
|
579
|
-
"max",
|
|
580
|
-
"min",
|
|
581
|
-
"pow",
|
|
582
|
-
"random",
|
|
583
|
-
"round",
|
|
584
|
-
"sign",
|
|
585
|
-
"sin",
|
|
586
|
-
"sinh",
|
|
587
|
-
"sqrt",
|
|
588
|
-
"tan",
|
|
589
|
-
"tanh"
|
|
590
|
-
], Mt = new RegExp(
|
|
591
|
-
[
|
|
592
|
-
// Allow the 4 basic operations, parentheses and all numbers/decimals, as well
|
|
593
|
-
// as 'x', for the variable usage.
|
|
594
|
-
"[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"
|
|
595
|
-
].concat(ct).join("|"),
|
|
596
|
-
"g"
|
|
597
|
-
);
|
|
598
|
-
function Et(i) {
|
|
599
|
-
const t = i.match(Mt);
|
|
600
|
-
for (let e = t.length - 1; e >= 0; --e)
|
|
601
|
-
ct.indexOf(t[e]) >= 0 && (t[e] = `Math.${t[e]}`);
|
|
602
|
-
return i = t.join(""), new Function("x", `return ${i};`);
|
|
603
|
-
}
|
|
604
|
-
class G {
|
|
605
|
-
constructor(t) {
|
|
606
|
-
// *MUST* happen after other behaviors do initialization so that we can read initial transformations
|
|
607
|
-
s(this, "order", p.Late);
|
|
608
|
-
/**
|
|
609
|
-
* The function representing the path the particle should take.
|
|
610
|
-
*/
|
|
611
|
-
s(this, "path");
|
|
612
|
-
s(this, "list");
|
|
613
|
-
s(this, "minMult");
|
|
614
|
-
if (t.path)
|
|
615
|
-
if (typeof t.path == "function")
|
|
616
|
-
this.path = t.path;
|
|
617
|
-
else
|
|
618
|
-
try {
|
|
619
|
-
this.path = Et(t.path);
|
|
620
|
-
} catch {
|
|
621
|
-
this.path = null;
|
|
649
|
+
/**
|
|
650
|
+
* Updates all particles spawned by this emitter and emits new ones.
|
|
651
|
+
* @param delta Time elapsed since the previous frame, in __seconds__.
|
|
652
|
+
*/
|
|
653
|
+
update(t) {
|
|
654
|
+
if (typeof t != "number" && (t = t.deltaMS * 1e-3), this._autoUpdate && (t = st.elapsedMS * 1e-3), !this._parent) return;
|
|
655
|
+
for (let n = this._activeParticlesFirst, o; n; n = o)
|
|
656
|
+
if (o = n.next, n.age += t, n.age > n.maxLife || n.age < 0)
|
|
657
|
+
this.recycle(n);
|
|
658
|
+
else {
|
|
659
|
+
let c = n.age * n.oneOverLife;
|
|
660
|
+
this.customEase && (this.customEase.length === 4 ? c = this.customEase(c, 0, 1, 1) : c = this.customEase(c)), n.agePercent = c;
|
|
661
|
+
for (let u = 0; u < this.updateBehaviors.length; ++u)
|
|
662
|
+
if (this.updateBehaviors[u].updateParticle(n, t)) {
|
|
663
|
+
this.recycle(n);
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
let e, a;
|
|
668
|
+
this._prevPosIsValid && (e = this._prevEmitterPos.x, a = this._prevEmitterPos.y);
|
|
669
|
+
const r = this.ownerPos.x + this.spawnPos.x, l = this.ownerPos.y + this.spawnPos.y;
|
|
670
|
+
if (this._emit)
|
|
671
|
+
for (this._spawnTimer -= t < 0 ? 0 : t; this._spawnTimer <= 0; ) {
|
|
672
|
+
if (this._emitterLife >= 0 && (this._emitterLife -= this._frequency, this._emitterLife <= 0)) {
|
|
673
|
+
this._spawnTimer = 0, this._emitterLife = 0, this.emit = !1;
|
|
674
|
+
break;
|
|
622
675
|
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
676
|
+
if (this.particleCount >= this.maxParticles) {
|
|
677
|
+
this._spawnTimer += this._frequency;
|
|
678
|
+
continue;
|
|
679
|
+
}
|
|
680
|
+
let n, o;
|
|
681
|
+
if (this._prevPosIsValid && this._posChanged) {
|
|
682
|
+
const d = 1 + this._spawnTimer / t;
|
|
683
|
+
n = (r - e) * d + e, o = (l - a) * d + a;
|
|
684
|
+
} else
|
|
685
|
+
n = r, o = l;
|
|
686
|
+
let c = null, u = null;
|
|
687
|
+
for (let d = Math.min(this.particlesPerWave, this.maxParticles - this.particleCount), y = 0; y < d; ++y) {
|
|
688
|
+
if (this.spawnChance < 1 && Math.random() >= this.spawnChance)
|
|
689
|
+
continue;
|
|
690
|
+
let f;
|
|
691
|
+
if (this.minLifetime === this.maxLifetime ? f = this.minLifetime : f = Math.random() * (this.maxLifetime - this.minLifetime) + this.minLifetime, -this._spawnTimer >= f)
|
|
692
|
+
continue;
|
|
693
|
+
let x;
|
|
694
|
+
this._poolFirst ? (x = this._poolFirst, this._poolFirst = this._poolFirst.next, x.next = null) : x = this._createParticle(), x.init(f), this._addParticleToParent(x), c ? (u.next = x, x.prev = u, u = x) : u = c = x, ++this.particleCount;
|
|
695
|
+
}
|
|
696
|
+
if (c) {
|
|
697
|
+
this._activeParticlesLast ? (this._activeParticlesLast.next = c, c.prev = this._activeParticlesLast, this._activeParticlesLast = u) : (this._activeParticlesFirst = c, this._activeParticlesLast = u);
|
|
698
|
+
for (let d = 0; d < this.initBehaviors.length; ++d) {
|
|
699
|
+
const y = this.initBehaviors[d];
|
|
700
|
+
if (y === b)
|
|
701
|
+
for (let f = c, x; f; f = x) {
|
|
702
|
+
x = f.next, this.rotation !== 0 && (w(this.rotation, f.position), f.rotation += this.rotation), f.position.x += n, f.position.y += o, f.age += -this._spawnTimer;
|
|
703
|
+
let h = f.age * f.oneOverLife;
|
|
704
|
+
this.customEase && (this.customEase.length === 4 ? h = this.customEase(h, 0, 1, 1) : h = this.customEase(h)), f.agePercent = h;
|
|
705
|
+
}
|
|
706
|
+
else
|
|
707
|
+
y.initParticles(c);
|
|
708
|
+
}
|
|
709
|
+
for (let d = c, y; d; d = y) {
|
|
710
|
+
y = d.next;
|
|
711
|
+
for (let f = 0; f < this.updateBehaviors.length; ++f)
|
|
712
|
+
if (this.updateBehaviors[f].updateParticle(d, -this._spawnTimer)) {
|
|
713
|
+
this.recycle(d);
|
|
714
|
+
break;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
this._spawnTimer += this._frequency;
|
|
719
|
+
}
|
|
720
|
+
if (this._posChanged && (this._prevEmitterPos.x = r, this._prevEmitterPos.y = l, this._prevPosIsValid = !0, this._posChanged = !1), !this._emit && !this._activeParticlesFirst) {
|
|
721
|
+
if (this._completeCallback) {
|
|
722
|
+
const n = this._completeCallback;
|
|
723
|
+
this._completeCallback = null, n();
|
|
724
|
+
}
|
|
725
|
+
this._destroyWhenComplete && this.destroy();
|
|
633
726
|
}
|
|
634
727
|
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
728
|
+
/**
|
|
729
|
+
* Emits a single wave of particles, using standard spawnChance & particlesPerWave settings. Does not affect
|
|
730
|
+
* regular spawning through the frequency, and ignores the emit property. The max particle count is respected, however,
|
|
731
|
+
* so if there are already too many particles then nothing will happen.
|
|
732
|
+
*/
|
|
733
|
+
emitNow() {
|
|
734
|
+
const t = this.ownerPos.x + this.spawnPos.x, e = this.ownerPos.y + this.spawnPos.y;
|
|
735
|
+
let a = null, r = null;
|
|
736
|
+
for (let l = Math.min(this.particlesPerWave, this.maxParticles - this.particleCount), n = 0; n < l; ++n) {
|
|
737
|
+
if (this.spawnChance < 1 && Math.random() >= this.spawnChance)
|
|
738
|
+
continue;
|
|
739
|
+
let o;
|
|
740
|
+
this._poolFirst ? (o = this._poolFirst, this._poolFirst = this._poolFirst.next, o.next = null) : o = this._createParticle();
|
|
741
|
+
let c;
|
|
742
|
+
this.minLifetime === this.maxLifetime ? c = this.minLifetime : c = Math.random() * (this.maxLifetime - this.minLifetime) + this.minLifetime, o.init(c), this._addParticleToParent(o), a ? (r.next = o, o.prev = r, r = o) : r = a = o, ++this.particleCount;
|
|
743
|
+
}
|
|
744
|
+
if (a) {
|
|
745
|
+
this._activeParticlesLast ? (this._activeParticlesLast.next = a, a.prev = this._activeParticlesLast, this._activeParticlesLast = r) : (this._activeParticlesFirst = a, this._activeParticlesLast = r);
|
|
746
|
+
for (let l = 0; l < this.initBehaviors.length; ++l) {
|
|
747
|
+
const n = this.initBehaviors[l];
|
|
748
|
+
if (n === b)
|
|
749
|
+
for (let o = a, c; o; o = c)
|
|
750
|
+
c = o.next, this.rotation !== 0 && (w(this.rotation, o.position), o.rotation += this.rotation), o.position.x += t, o.position.y += e;
|
|
751
|
+
else
|
|
752
|
+
n.initParticles(a);
|
|
753
|
+
}
|
|
661
754
|
}
|
|
662
755
|
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
s(this, "maxSpeed");
|
|
672
|
-
s(this, "accel");
|
|
673
|
-
this.minStart = t.minStart * _, this.maxStart = t.maxStart * _, this.minSpeed = t.minSpeed * _, this.maxSpeed = t.maxSpeed * _, this.accel = t.accel * _;
|
|
674
|
-
}
|
|
675
|
-
initParticles(t) {
|
|
676
|
-
let e = t;
|
|
677
|
-
for (; e; )
|
|
678
|
-
this.minStart === this.maxStart ? e.rotation += this.maxStart : e.rotation += Math.random() * (this.maxStart - this.minStart) + this.minStart, e.config.rotSpeed = Math.random() * (this.maxSpeed - this.minSpeed) + this.minSpeed, e = e.next;
|
|
756
|
+
/**
|
|
757
|
+
* Kills all active particles immediately.
|
|
758
|
+
*/
|
|
759
|
+
cleanup() {
|
|
760
|
+
let t, e;
|
|
761
|
+
for (t = this._activeParticlesFirst; t; t = e)
|
|
762
|
+
e = t.next, this.recycle(t, !0);
|
|
763
|
+
this._activeParticlesFirst = this._activeParticlesLast = null, this.particleCount = 0;
|
|
679
764
|
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
s(Q, "type", "rotation"), s(Q, "editorConfig", null);
|
|
689
|
-
class H {
|
|
690
|
-
constructor(t) {
|
|
691
|
-
s(this, "order", p.Normal);
|
|
692
|
-
s(this, "min");
|
|
693
|
-
s(this, "max");
|
|
694
|
-
this.min = t.min * _, this.max = t.max * _;
|
|
695
|
-
}
|
|
696
|
-
initParticles(t) {
|
|
697
|
-
let e = t;
|
|
698
|
-
for (; e; )
|
|
699
|
-
this.min === this.max ? e.rotation += this.max : e.rotation += Math.random() * (this.max - this.min) + this.min, e = e.next;
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
s(H, "type", "rotationStatic"), s(H, "editorConfig", null);
|
|
703
|
-
class J {
|
|
704
|
-
constructor(t) {
|
|
705
|
-
s(this, "order", p.Late + 1);
|
|
706
|
-
s(this, "rotation");
|
|
707
|
-
this.rotation = (t.rotation || 0) * _;
|
|
708
|
-
}
|
|
709
|
-
initParticles(t) {
|
|
710
|
-
let e = t;
|
|
711
|
-
for (; e; )
|
|
712
|
-
e.rotation = this.rotation, e = e.next;
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
s(J, "type", "noRotation"), s(J, "editorConfig", null);
|
|
716
|
-
class K {
|
|
717
|
-
constructor(t) {
|
|
718
|
-
s(this, "order", p.Normal);
|
|
719
|
-
s(this, "list");
|
|
720
|
-
s(this, "minMult");
|
|
721
|
-
this.list = new R(!1), this.list.reset(P.createList(t.scale)), this.minMult = t.minMult ?? 1;
|
|
722
|
-
}
|
|
723
|
-
initParticles(t) {
|
|
724
|
-
let e = t;
|
|
725
|
-
for (; e; ) {
|
|
726
|
-
const a = Math.random() * (1 - this.minMult) + this.minMult;
|
|
727
|
-
e.config.scaleMult = a, e.scale.x = e.scale.y = this.list.first.value * a, e = e.next;
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
updateParticle(t) {
|
|
731
|
-
t.scale.x = t.scale.y = this.list.interpolate(t.agePercent) * t.config.scaleMult;
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
s(K, "type", "scale"), s(K, "editorConfig", null);
|
|
735
|
-
class Z {
|
|
736
|
-
constructor(t) {
|
|
737
|
-
s(this, "order", p.Normal);
|
|
738
|
-
s(this, "min");
|
|
739
|
-
s(this, "max");
|
|
740
|
-
this.min = t.min, this.max = t.max;
|
|
741
|
-
}
|
|
742
|
-
initParticles(t) {
|
|
743
|
-
let e = t;
|
|
744
|
-
for (; e; ) {
|
|
745
|
-
const a = Math.random() * (this.max - this.min) + this.min;
|
|
746
|
-
e.scale.x = e.scale.y = a, e = e.next;
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
s(Z, "type", "scaleStatic"), s(Z, "editorConfig", null);
|
|
751
|
-
const L = class L {
|
|
752
|
-
constructor(t) {
|
|
753
|
-
s(this, "order", p.Spawn);
|
|
754
|
-
s(this, "shape");
|
|
755
|
-
const e = L.shapes[t.type];
|
|
756
|
-
if (!e)
|
|
757
|
-
throw new Error(`No shape found with type '${t.type}'`);
|
|
758
|
-
this.shape = new e(t.data);
|
|
765
|
+
/**
|
|
766
|
+
* If this emitter has been destroyed. Note that a destroyed emitter can still be reused, after
|
|
767
|
+
* having a new parent set and being reinitialized.
|
|
768
|
+
*/
|
|
769
|
+
get destroyed() {
|
|
770
|
+
return !(this._parent && this.initBehaviors.length);
|
|
759
771
|
}
|
|
760
772
|
/**
|
|
761
|
-
*
|
|
762
|
-
* @param constructor The shape class constructor to use, with a static `type` property to reference it by.
|
|
763
|
-
* @param typeOverride An optional type override, primarily for registering a shape under multiple names.
|
|
773
|
+
* Destroys the emitter and all of its particles.
|
|
764
774
|
*/
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
this.shape.getRandPos(e), e = e.next;
|
|
775
|
+
destroy() {
|
|
776
|
+
this.autoUpdate = !1, this.cleanup();
|
|
777
|
+
let t;
|
|
778
|
+
for (let e = this._poolFirst; e; e = t)
|
|
779
|
+
t = e.next, e.destroy();
|
|
780
|
+
this._poolFirst = this._parent = this.spawnPos = this.ownerPos = this.customEase = this._completeCallback = null, this.initBehaviors.length = this.updateBehaviors.length = this.recycleBehaviors.length = 0;
|
|
772
781
|
}
|
|
773
782
|
};
|
|
774
|
-
s(L, "
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
* Initializes the particle for use, based on the properties that have to
|
|
1040
|
-
* have been set already on the particle.
|
|
1041
|
-
*/
|
|
1042
|
-
init(e) {
|
|
1043
|
-
this.maxLife = e, this.age = this.agePercent = 0, this.rotation = 0, this.position.x = this.position.y = 0, this.scale.x = this.scale.y = 1, this.tint = 16777215, this.alpha = 1, this.oneOverLife = 1 / this.maxLife, this.visible = !0;
|
|
1044
|
-
}
|
|
1045
|
-
/**
|
|
1046
|
-
* Kills the particle, removing it from the display list
|
|
1047
|
-
* and telling the emitter to recycle it.
|
|
1048
|
-
*/
|
|
1049
|
-
kill() {
|
|
1050
|
-
this.emitter.recycle(this);
|
|
1051
|
-
}
|
|
1052
|
-
/**
|
|
1053
|
-
* Destroys the particle, removing references and preventing future use.
|
|
1054
|
-
*/
|
|
1055
|
-
destroy() {
|
|
1056
|
-
this.parent && this.parent.removeChild(this), this.emitter = this.next = this.prev = null, super.destroy();
|
|
783
|
+
s(L, "knownBehaviors", {});
|
|
784
|
+
let m = L;
|
|
785
|
+
function Vt(i, t) {
|
|
786
|
+
var a, r, l, n, o, c, u, d, y, f, x;
|
|
787
|
+
if ("behaviors" in i)
|
|
788
|
+
return i;
|
|
789
|
+
const e = {
|
|
790
|
+
lifetime: i.lifetime,
|
|
791
|
+
ease: i.ease,
|
|
792
|
+
particlesPerWave: i.particlesPerWave,
|
|
793
|
+
frequency: i.frequency,
|
|
794
|
+
spawnChance: i.spawnChance,
|
|
795
|
+
emitterLifetime: i.emitterLifetime,
|
|
796
|
+
maxParticles: i.maxParticles,
|
|
797
|
+
addAtBack: i.addAtBack,
|
|
798
|
+
pos: i.pos,
|
|
799
|
+
emit: i.emit,
|
|
800
|
+
autoUpdate: i.autoUpdate,
|
|
801
|
+
behaviors: []
|
|
802
|
+
};
|
|
803
|
+
if (i.alpha)
|
|
804
|
+
if ("start" in i.alpha)
|
|
805
|
+
if (i.alpha.start === i.alpha.end)
|
|
806
|
+
i.alpha.start !== 1 && e.behaviors.push({
|
|
807
|
+
type: "alphaStatic",
|
|
808
|
+
config: { alpha: i.alpha.start }
|
|
809
|
+
});
|
|
810
|
+
else {
|
|
811
|
+
const h = {
|
|
812
|
+
list: [
|
|
813
|
+
{ time: 0, value: i.alpha.start },
|
|
814
|
+
{ time: 1, value: i.alpha.end }
|
|
815
|
+
]
|
|
816
|
+
};
|
|
817
|
+
e.behaviors.push({
|
|
818
|
+
type: "alpha",
|
|
819
|
+
config: { alpha: h }
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
else i.alpha.list.length === 1 ? i.alpha.list[0].value !== 1 && e.behaviors.push({
|
|
823
|
+
type: "alphaStatic",
|
|
824
|
+
config: { alpha: i.alpha.list[0].value }
|
|
825
|
+
}) : e.behaviors.push({
|
|
826
|
+
type: "alpha",
|
|
827
|
+
config: { alpha: i.alpha }
|
|
828
|
+
});
|
|
829
|
+
if (i.acceleration && (i.acceleration.x || i.acceleration.y)) {
|
|
830
|
+
let h, v;
|
|
831
|
+
"start" in i.speed ? (h = i.speed.start * (i.speed.minimumSpeedMultiplier ?? 1), v = i.speed.start) : (h = i.speed.list[0].value * (i.minimumSpeedMultiplier ?? 1), v = i.speed.list[0].value), e.behaviors.push({
|
|
832
|
+
type: "moveAcceleration",
|
|
833
|
+
config: {
|
|
834
|
+
accel: i.acceleration,
|
|
835
|
+
minStart: h,
|
|
836
|
+
maxStart: v,
|
|
837
|
+
rotate: !i.noRotation,
|
|
838
|
+
maxSpeed: i.maxSpeed
|
|
839
|
+
}
|
|
840
|
+
});
|
|
841
|
+
} else if ((a = i.extraData) != null && a.path) {
|
|
842
|
+
let h, v;
|
|
843
|
+
"start" in i.speed ? (v = i.speed.minimumSpeedMultiplier ?? 1, i.speed.start === i.speed.end ? h = {
|
|
844
|
+
list: [{ time: 0, value: i.speed.start }]
|
|
845
|
+
} : h = {
|
|
846
|
+
list: [
|
|
847
|
+
{ time: 0, value: i.speed.start },
|
|
848
|
+
{ time: 1, value: i.speed.end }
|
|
849
|
+
]
|
|
850
|
+
}) : (h = i.speed, v = i.minimumSpeedMultiplier ?? 1), e.behaviors.push({
|
|
851
|
+
type: "movePath",
|
|
852
|
+
config: {
|
|
853
|
+
path: i.extraData.path,
|
|
854
|
+
speed: h,
|
|
855
|
+
minMult: v
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
} else if (i.speed)
|
|
859
|
+
if ("start" in i.speed)
|
|
860
|
+
if (i.speed.start === i.speed.end)
|
|
861
|
+
e.behaviors.push({
|
|
862
|
+
type: "moveSpeedStatic",
|
|
863
|
+
config: {
|
|
864
|
+
min: i.speed.start * (i.speed.minimumSpeedMultiplier ?? 1),
|
|
865
|
+
max: i.speed.start
|
|
866
|
+
}
|
|
867
|
+
});
|
|
868
|
+
else {
|
|
869
|
+
const h = {
|
|
870
|
+
list: [
|
|
871
|
+
{ time: 0, value: i.speed.start },
|
|
872
|
+
{ time: 1, value: i.speed.end }
|
|
873
|
+
]
|
|
874
|
+
};
|
|
875
|
+
e.behaviors.push({
|
|
876
|
+
type: "moveSpeed",
|
|
877
|
+
config: { speed: h, minMult: i.speed.minimumSpeedMultiplier }
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
else i.speed.list.length === 1 ? e.behaviors.push({
|
|
881
|
+
type: "moveSpeedStatic",
|
|
882
|
+
config: {
|
|
883
|
+
min: i.speed.list[0].value * (i.minimumSpeedMultiplier ?? 1),
|
|
884
|
+
max: i.speed.list[0].value
|
|
885
|
+
}
|
|
886
|
+
}) : e.behaviors.push({
|
|
887
|
+
type: "moveSpeed",
|
|
888
|
+
config: { speed: i.speed, minMult: i.minimumSpeedMultiplier ?? 1 }
|
|
889
|
+
});
|
|
890
|
+
if (i.scale)
|
|
891
|
+
if ("start" in i.scale) {
|
|
892
|
+
const h = i.scale.minimumScaleMultiplier ?? 1;
|
|
893
|
+
if (i.scale.start === i.scale.end)
|
|
894
|
+
e.behaviors.push({
|
|
895
|
+
type: "scaleStatic",
|
|
896
|
+
config: {
|
|
897
|
+
min: i.scale.start * h,
|
|
898
|
+
max: i.scale.start
|
|
899
|
+
}
|
|
900
|
+
});
|
|
901
|
+
else {
|
|
902
|
+
const v = {
|
|
903
|
+
list: [
|
|
904
|
+
{ time: 0, value: i.scale.start },
|
|
905
|
+
{ time: 1, value: i.scale.end }
|
|
906
|
+
]
|
|
907
|
+
};
|
|
908
|
+
e.behaviors.push({
|
|
909
|
+
type: "scale",
|
|
910
|
+
config: { scale: v, minMult: h }
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
} else if (i.scale.list.length === 1) {
|
|
914
|
+
const h = i.minimumScaleMultiplier ?? 1, v = i.scale.list[0].value;
|
|
915
|
+
e.behaviors.push({
|
|
916
|
+
type: "scaleStatic",
|
|
917
|
+
config: { min: v * h, max: v }
|
|
918
|
+
});
|
|
919
|
+
} else
|
|
920
|
+
e.behaviors.push({
|
|
921
|
+
type: "scale",
|
|
922
|
+
config: { scale: i.scale, minMult: i.minimumScaleMultiplier ?? 1 }
|
|
923
|
+
});
|
|
924
|
+
if (i.color)
|
|
925
|
+
if ("start" in i.color)
|
|
926
|
+
if (i.color.start === i.color.end)
|
|
927
|
+
i.color.start !== "ffffff" && e.behaviors.push({
|
|
928
|
+
type: "colorStatic",
|
|
929
|
+
config: { color: i.color.start }
|
|
930
|
+
});
|
|
931
|
+
else {
|
|
932
|
+
const h = {
|
|
933
|
+
list: [
|
|
934
|
+
{ time: 0, value: i.color.start },
|
|
935
|
+
{ time: 1, value: i.color.end }
|
|
936
|
+
]
|
|
937
|
+
};
|
|
938
|
+
e.behaviors.push({
|
|
939
|
+
type: "color",
|
|
940
|
+
config: { color: h }
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
else i.color.list.length === 1 ? i.color.list[0].value !== "ffffff" && e.behaviors.push({
|
|
944
|
+
type: "colorStatic",
|
|
945
|
+
config: { color: i.color.list[0].value }
|
|
946
|
+
}) : e.behaviors.push({
|
|
947
|
+
type: "color",
|
|
948
|
+
config: { color: i.color }
|
|
949
|
+
});
|
|
950
|
+
if (i.rotationAcceleration || (r = i.rotationSpeed) != null && r.min || (l = i.rotationSpeed) != null && l.max ? e.behaviors.push({
|
|
951
|
+
type: "rotation",
|
|
952
|
+
config: {
|
|
953
|
+
accel: i.rotationAcceleration || 0,
|
|
954
|
+
minSpeed: ((n = i.rotationSpeed) == null ? void 0 : n.min) || 0,
|
|
955
|
+
maxSpeed: ((o = i.rotationSpeed) == null ? void 0 : o.max) || 0,
|
|
956
|
+
minStart: ((c = i.startRotation) == null ? void 0 : c.min) || 0,
|
|
957
|
+
maxStart: ((u = i.startRotation) == null ? void 0 : u.max) || 0
|
|
958
|
+
}
|
|
959
|
+
}) : ((d = i.startRotation) != null && d.min || (y = i.startRotation) != null && y.max) && e.behaviors.push({
|
|
960
|
+
type: "rotationStatic",
|
|
961
|
+
config: {
|
|
962
|
+
min: ((f = i.startRotation) == null ? void 0 : f.min) || 0,
|
|
963
|
+
max: ((x = i.startRotation) == null ? void 0 : x.max) || 0
|
|
964
|
+
}
|
|
965
|
+
}), i.noRotation && e.behaviors.push({
|
|
966
|
+
type: "noRotation",
|
|
967
|
+
config: {}
|
|
968
|
+
}), i.blendMode && i.blendMode !== "normal" && e.behaviors.push({
|
|
969
|
+
type: "blendMode",
|
|
970
|
+
config: {
|
|
971
|
+
blendMode: i.blendMode
|
|
972
|
+
}
|
|
973
|
+
}), Array.isArray(t) && typeof t[0] != "string" && "framerate" in t[0]) {
|
|
974
|
+
for (let h = 0; h < t.length; ++h)
|
|
975
|
+
t[h].framerate === "matchLife" && (t[h].framerate = -1);
|
|
976
|
+
e.behaviors.push({
|
|
977
|
+
type: "animatedRandom",
|
|
978
|
+
config: {
|
|
979
|
+
anims: t
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
} else typeof t != "string" && "framerate" in t ? (t.framerate === "matchLife" && (t.framerate = -1), e.behaviors.push({
|
|
983
|
+
type: "animatedSingle",
|
|
984
|
+
config: {
|
|
985
|
+
anim: t
|
|
986
|
+
}
|
|
987
|
+
})) : i.orderedArt && Array.isArray(t) ? e.behaviors.push({
|
|
988
|
+
type: "textureOrdered",
|
|
989
|
+
config: {
|
|
990
|
+
textures: t
|
|
991
|
+
}
|
|
992
|
+
}) : Array.isArray(t) ? e.behaviors.push({
|
|
993
|
+
type: "textureRandom",
|
|
994
|
+
config: {
|
|
995
|
+
textures: t
|
|
996
|
+
}
|
|
997
|
+
}) : e.behaviors.push({
|
|
998
|
+
type: "textureSingle",
|
|
999
|
+
config: {
|
|
1000
|
+
texture: t
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
if (i.spawnType === "burst")
|
|
1004
|
+
e.behaviors.push({
|
|
1005
|
+
type: "spawnBurst",
|
|
1006
|
+
config: {
|
|
1007
|
+
start: i.angleStart || 0,
|
|
1008
|
+
spacing: i.particleSpacing,
|
|
1009
|
+
// older formats bursted from a single point
|
|
1010
|
+
distance: 0
|
|
1011
|
+
}
|
|
1012
|
+
});
|
|
1013
|
+
else if (i.spawnType === "point")
|
|
1014
|
+
e.behaviors.push({
|
|
1015
|
+
type: "spawnPoint",
|
|
1016
|
+
config: {}
|
|
1017
|
+
});
|
|
1018
|
+
else {
|
|
1019
|
+
let h;
|
|
1020
|
+
i.spawnType === "ring" ? h = {
|
|
1021
|
+
type: "torus",
|
|
1022
|
+
data: {
|
|
1023
|
+
x: i.spawnCircle.x,
|
|
1024
|
+
y: i.spawnCircle.y,
|
|
1025
|
+
radius: i.spawnCircle.r,
|
|
1026
|
+
innerRadius: i.spawnCircle.minR,
|
|
1027
|
+
affectRotation: !0
|
|
1028
|
+
}
|
|
1029
|
+
} : i.spawnType === "circle" ? h = {
|
|
1030
|
+
type: "torus",
|
|
1031
|
+
data: {
|
|
1032
|
+
x: i.spawnCircle.x,
|
|
1033
|
+
y: i.spawnCircle.y,
|
|
1034
|
+
radius: i.spawnCircle.r,
|
|
1035
|
+
innerRadius: 0,
|
|
1036
|
+
affectRotation: !1
|
|
1037
|
+
}
|
|
1038
|
+
} : i.spawnType === "rect" ? h = {
|
|
1039
|
+
type: "rect",
|
|
1040
|
+
data: i.spawnRect
|
|
1041
|
+
} : i.spawnType === "polygonalChain" && (h = {
|
|
1042
|
+
type: "polygonalChain",
|
|
1043
|
+
data: i.spawnPolygon
|
|
1044
|
+
}), h && e.behaviors.push({
|
|
1045
|
+
type: "spawnShape",
|
|
1046
|
+
config: h
|
|
1047
|
+
});
|
|
1057
1048
|
}
|
|
1049
|
+
return e;
|
|
1058
1050
|
}
|
|
1059
|
-
|
|
1051
|
+
class O {
|
|
1060
1052
|
/**
|
|
1061
|
-
* @param
|
|
1062
|
-
* @param particleImages A texture or array of textures to use
|
|
1063
|
-
* for the particles. Strings will be turned
|
|
1064
|
-
* into textures via Texture.from().
|
|
1065
|
-
* @param config A configuration object containing settings for the emitter.
|
|
1066
|
-
* @param config.emit If config.emit is explicitly passed as false, the
|
|
1067
|
-
* Emitter will start disabled.
|
|
1068
|
-
* @param config.autoUpdate If config.autoUpdate is explicitly passed as
|
|
1069
|
-
* true, the Emitter will automatically call
|
|
1070
|
-
* update via the PIXI shared ticker.
|
|
1053
|
+
* @param data Point data for polygon chains. Either a list of points for a single chain, or a list of chains.
|
|
1071
1054
|
*/
|
|
1072
|
-
constructor(t
|
|
1073
|
-
/**
|
|
1074
|
-
* Active initialization behaviors for this emitter.
|
|
1075
|
-
*/
|
|
1076
|
-
s(this, "initBehaviors");
|
|
1055
|
+
constructor(t) {
|
|
1077
1056
|
/**
|
|
1078
|
-
*
|
|
1057
|
+
* List of segment objects in the chain.
|
|
1079
1058
|
*/
|
|
1080
|
-
s(this, "
|
|
1059
|
+
s(this, "segments");
|
|
1081
1060
|
/**
|
|
1082
|
-
*
|
|
1061
|
+
* Total length of all segments of the chain.
|
|
1083
1062
|
*/
|
|
1084
|
-
s(this, "
|
|
1085
|
-
// properties for individual particles
|
|
1063
|
+
s(this, "totalLength");
|
|
1086
1064
|
/**
|
|
1087
|
-
*
|
|
1065
|
+
* Total length of segments up to and including the segment of the same index.
|
|
1066
|
+
* Used for weighted random selection of segment.
|
|
1088
1067
|
*/
|
|
1089
|
-
s(this, "
|
|
1068
|
+
s(this, "countingLengths");
|
|
1069
|
+
this.segments = [], this.countingLengths = [], this.totalLength = 0, this.init(t);
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* @param data Point data for polygon chains. Either a list of points for a single chain, or a list of chains.
|
|
1073
|
+
*/
|
|
1074
|
+
init(t) {
|
|
1075
|
+
if (!t || !t.length)
|
|
1076
|
+
this.segments.push({ p1: { x: 0, y: 0 }, p2: { x: 0, y: 0 }, l: 0 });
|
|
1077
|
+
else if (Array.isArray(t[0]))
|
|
1078
|
+
for (let e = 0; e < t.length; ++e) {
|
|
1079
|
+
const a = t[e];
|
|
1080
|
+
let r = a[0];
|
|
1081
|
+
for (let l = 1; l < a.length; ++l) {
|
|
1082
|
+
const n = a[l];
|
|
1083
|
+
this.segments.push({ p1: r, p2: n, l: 0 }), r = n;
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
else {
|
|
1087
|
+
let e = t[0];
|
|
1088
|
+
for (let a = 1; a < t.length; ++a) {
|
|
1089
|
+
const r = t[a];
|
|
1090
|
+
this.segments.push({ p1: e, p2: r, l: 0 }), e = r;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
for (let e = 0; e < this.segments.length; ++e) {
|
|
1094
|
+
const { p1: a, p2: r } = this.segments[e], l = Math.sqrt((r.x - a.x) * (r.x - a.x) + (r.y - a.y) * (r.y - a.y));
|
|
1095
|
+
this.segments[e].l = l, this.totalLength += l, this.countingLengths.push(this.totalLength);
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Gets a random point in the chain.
|
|
1100
|
+
* @param out The point to store the selected position in.
|
|
1101
|
+
*/
|
|
1102
|
+
getRandPos(t) {
|
|
1103
|
+
const e = Math.random() * this.totalLength;
|
|
1104
|
+
let a, r;
|
|
1105
|
+
if (this.segments.length === 1)
|
|
1106
|
+
a = this.segments[0], r = e;
|
|
1107
|
+
else
|
|
1108
|
+
for (let o = 0; o < this.countingLengths.length; ++o)
|
|
1109
|
+
if (e < this.countingLengths[o]) {
|
|
1110
|
+
a = this.segments[o], r = o === 0 ? e : e - this.countingLengths[o - 1];
|
|
1111
|
+
break;
|
|
1112
|
+
}
|
|
1113
|
+
r /= a.l || 1;
|
|
1114
|
+
const { p1: l, p2: n } = a;
|
|
1115
|
+
t.x = l.x + r * (n.x - l.x), t.y = l.y + r * (n.y - l.y);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
s(O, "type", "polygonalChain"), s(O, "editorConfig", null);
|
|
1119
|
+
class A {
|
|
1120
|
+
constructor(t) {
|
|
1090
1121
|
/**
|
|
1091
|
-
*
|
|
1122
|
+
* X (left) position of the rectangle.
|
|
1092
1123
|
*/
|
|
1093
|
-
s(this, "
|
|
1124
|
+
s(this, "x");
|
|
1094
1125
|
/**
|
|
1095
|
-
*
|
|
1096
|
-
* parameter of time as a value from 0-1, inclusive. Expected outputs are values
|
|
1097
|
-
* from 0-1, inclusive.
|
|
1126
|
+
* Y (top) position of the rectangle.
|
|
1098
1127
|
*/
|
|
1099
|
-
s(this, "
|
|
1100
|
-
// properties for spawning particles
|
|
1128
|
+
s(this, "y");
|
|
1101
1129
|
/**
|
|
1102
|
-
*
|
|
1130
|
+
* Width of the rectangle.
|
|
1103
1131
|
*/
|
|
1104
|
-
s(this, "
|
|
1132
|
+
s(this, "w");
|
|
1105
1133
|
/**
|
|
1106
|
-
*
|
|
1107
|
-
* 0 is 0%, 1 is 100%.
|
|
1134
|
+
* Height of the rectangle.
|
|
1108
1135
|
*/
|
|
1109
|
-
s(this, "
|
|
1136
|
+
s(this, "h");
|
|
1137
|
+
this.x = t.x, this.y = t.y, this.w = t.w, this.h = t.h;
|
|
1138
|
+
}
|
|
1139
|
+
getRandPos(t) {
|
|
1140
|
+
t.x = Math.random() * this.w + this.x, t.y = Math.random() * this.h + this.y;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
s(A, "type", "rect"), s(A, "editorConfig", null);
|
|
1144
|
+
class T {
|
|
1145
|
+
constructor(t) {
|
|
1110
1146
|
/**
|
|
1111
|
-
*
|
|
1112
|
-
* is reached, no more particles will spawn until some have died.
|
|
1147
|
+
* X position of the center of the shape.
|
|
1113
1148
|
*/
|
|
1114
|
-
s(this, "
|
|
1149
|
+
s(this, "x");
|
|
1115
1150
|
/**
|
|
1116
|
-
*
|
|
1117
|
-
* A value of -1 is an unlimited amount of time.
|
|
1151
|
+
* Y position of the center of the shape.
|
|
1118
1152
|
*/
|
|
1119
|
-
s(this, "
|
|
1153
|
+
s(this, "y");
|
|
1120
1154
|
/**
|
|
1121
|
-
*
|
|
1122
|
-
* For example, the flames of a rocket travelling right might have a spawnPos
|
|
1123
|
-
* of {x:-50, y:0}.
|
|
1124
|
-
* to spawn at the rear of the rocket.
|
|
1125
|
-
* To change this, use updateSpawnPos().
|
|
1155
|
+
* Radius of circle, or outer radius of a ring.
|
|
1126
1156
|
*/
|
|
1127
|
-
s(this, "
|
|
1157
|
+
s(this, "radius");
|
|
1128
1158
|
/**
|
|
1129
|
-
*
|
|
1159
|
+
* Inner radius of a ring. Use 0 to have a circle.
|
|
1130
1160
|
*/
|
|
1131
|
-
s(this, "
|
|
1161
|
+
s(this, "innerRadius");
|
|
1132
1162
|
/**
|
|
1133
|
-
*
|
|
1134
|
-
* the calculated spawn angle.
|
|
1135
|
-
* To change this, use rotate().
|
|
1163
|
+
* If rotation should be applied to particles.
|
|
1136
1164
|
*/
|
|
1137
1165
|
s(this, "rotation");
|
|
1166
|
+
this.x = t.x || 0, this.y = t.y || 0, this.radius = t.radius, this.innerRadius = t.innerRadius || 0, this.rotation = !!t.affectRotation;
|
|
1167
|
+
}
|
|
1168
|
+
getRandPos(t) {
|
|
1169
|
+
this.innerRadius !== this.radius ? t.x = Math.random() * (this.radius - this.innerRadius) + this.innerRadius : t.x = this.radius, t.y = 0;
|
|
1170
|
+
const e = Math.random() * Math.PI * 2;
|
|
1171
|
+
this.rotation && (t.rotation += e), w(e, t.position), t.position.x += this.x, t.position.y += this.y;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
s(T, "type", "torus"), s(T, "editorConfig", null);
|
|
1175
|
+
const St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1176
|
+
__proto__: null,
|
|
1177
|
+
PolygonalChain: O,
|
|
1178
|
+
Rectangle: A,
|
|
1179
|
+
Torus: T
|
|
1180
|
+
}, Symbol.toStringTag, { value: "Module" })), bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1181
|
+
__proto__: null
|
|
1182
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1183
|
+
class I {
|
|
1184
|
+
constructor(t) {
|
|
1185
|
+
// doesn't _really_ need to be late, but doing so ensures that we can override any
|
|
1186
|
+
// rotation behavior that is mistakenly added
|
|
1187
|
+
s(this, "order", p.Late);
|
|
1188
|
+
s(this, "minStart");
|
|
1189
|
+
s(this, "maxStart");
|
|
1190
|
+
s(this, "accel");
|
|
1191
|
+
s(this, "rotate");
|
|
1192
|
+
s(this, "maxSpeed");
|
|
1193
|
+
this.minStart = t.minStart, this.maxStart = t.maxStart, this.accel = t.accel, this.rotate = !!t.rotate, this.maxSpeed = t.maxSpeed ?? 0;
|
|
1194
|
+
}
|
|
1195
|
+
initParticles(t) {
|
|
1196
|
+
let e = t;
|
|
1197
|
+
for (; e; ) {
|
|
1198
|
+
const a = Math.random() * (this.maxStart - this.minStart) + this.minStart;
|
|
1199
|
+
e.config.velocity ? e.config.velocity.set(a, 0) : e.config.velocity = new C(a, 0), w(e.rotation, e.config.velocity), e = e.next;
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
updateParticle(t, e) {
|
|
1203
|
+
const a = t.config.velocity, r = a.x, l = a.y;
|
|
1204
|
+
if (a.x += this.accel.x * e, a.y += this.accel.y * e, this.maxSpeed) {
|
|
1205
|
+
const n = at(a);
|
|
1206
|
+
n > this.maxSpeed && rt(a, this.maxSpeed / n);
|
|
1207
|
+
}
|
|
1208
|
+
t.x += (r + a.x) / 2 * e, t.y += (l + a.y) / 2 * e, this.rotate && (t.rotation = Math.atan2(a.y, a.x));
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
s(I, "type", "moveAcceleration"), s(I, "editorConfig", null);
|
|
1212
|
+
function Lt(i) {
|
|
1213
|
+
return this.ease && (i = this.ease(i)), (this.first.next.value - this.first.value) * i + this.first.value;
|
|
1214
|
+
}
|
|
1215
|
+
function Mt(i) {
|
|
1216
|
+
this.ease && (i = this.ease(i));
|
|
1217
|
+
const t = this.first.value, e = this.first.next.value, a = (e.r - t.r) * i + t.r, r = (e.g - t.g) * i + t.g, l = (e.b - t.b) * i + t.b;
|
|
1218
|
+
return k(a, r, l);
|
|
1219
|
+
}
|
|
1220
|
+
function Et(i) {
|
|
1221
|
+
this.ease && (i = this.ease(i));
|
|
1222
|
+
let t = this.first, { next: e } = t;
|
|
1223
|
+
for (; i > e.time; )
|
|
1224
|
+
t = e, e = e.next;
|
|
1225
|
+
return i = (i - t.time) / (e.time - t.time), (e.value - t.value) * i + t.value;
|
|
1226
|
+
}
|
|
1227
|
+
function Ft(i) {
|
|
1228
|
+
this.ease && (i = this.ease(i));
|
|
1229
|
+
let t = this.first, { next: e } = t;
|
|
1230
|
+
for (; i > e.time; )
|
|
1231
|
+
t = e, e = e.next;
|
|
1232
|
+
i = (i - t.time) / (e.time - t.time);
|
|
1233
|
+
const a = t.value, r = e.value, l = (r.r - a.r) * i + a.r, n = (r.g - a.g) * i + a.g, o = (r.b - a.b) * i + a.b;
|
|
1234
|
+
return k(l, n, o);
|
|
1235
|
+
}
|
|
1236
|
+
function Tt(i) {
|
|
1237
|
+
this.ease && (i = this.ease(i));
|
|
1238
|
+
let t = this.first;
|
|
1239
|
+
for (; t.next && i > t.next.time; )
|
|
1240
|
+
t = t.next;
|
|
1241
|
+
return t.value;
|
|
1242
|
+
}
|
|
1243
|
+
function Bt(i) {
|
|
1244
|
+
this.ease && (i = this.ease(i));
|
|
1245
|
+
let t = this.first;
|
|
1246
|
+
for (; t.next && i > t.next.time; )
|
|
1247
|
+
t = t.next;
|
|
1248
|
+
const e = t.value;
|
|
1249
|
+
return k(e.r, e.g, e.b);
|
|
1250
|
+
}
|
|
1251
|
+
class R {
|
|
1252
|
+
/**
|
|
1253
|
+
* @param isColor If this list handles color values
|
|
1254
|
+
*/
|
|
1255
|
+
constructor(t = !1) {
|
|
1138
1256
|
/**
|
|
1139
|
-
* The
|
|
1140
|
-
* spawning particles. To change this, use updateOwnerPos().
|
|
1141
|
-
*/
|
|
1142
|
-
s(this, "ownerPos");
|
|
1143
|
-
/**
|
|
1144
|
-
* The origin + spawnPos in the previous update, so that the spawn position
|
|
1145
|
-
* can be interpolated to space out particles better.
|
|
1146
|
-
*/
|
|
1147
|
-
s(this, "_prevEmitterPos");
|
|
1148
|
-
/**
|
|
1149
|
-
* If _prevEmitterPos is valid, to prevent interpolation on the first update
|
|
1150
|
-
*/
|
|
1151
|
-
s(this, "_prevPosIsValid");
|
|
1152
|
-
/**
|
|
1153
|
-
* If either ownerPos or spawnPos has changed since the previous update.
|
|
1154
|
-
*/
|
|
1155
|
-
s(this, "_posChanged");
|
|
1156
|
-
/**
|
|
1157
|
-
* The container to add particles to.
|
|
1158
|
-
*/
|
|
1159
|
-
s(this, "_parent");
|
|
1160
|
-
/**
|
|
1161
|
-
* If particles should be added at the back of the display list instead of the front.
|
|
1162
|
-
*/
|
|
1163
|
-
s(this, "addAtBack");
|
|
1164
|
-
/**
|
|
1165
|
-
* The current number of active particles.
|
|
1166
|
-
*/
|
|
1167
|
-
s(this, "particleCount");
|
|
1168
|
-
/**
|
|
1169
|
-
* If particles should be emitted during update() calls. Setting this to false
|
|
1170
|
-
* stops new particles from being created, but allows existing ones to die out.
|
|
1171
|
-
*/
|
|
1172
|
-
s(this, "_emit");
|
|
1173
|
-
/**
|
|
1174
|
-
* The timer for when to spawn particles in seconds, where numbers less
|
|
1175
|
-
* than 0 mean that particles should be spawned.
|
|
1176
|
-
*/
|
|
1177
|
-
s(this, "_spawnTimer");
|
|
1178
|
-
/**
|
|
1179
|
-
* The life of the emitter in seconds.
|
|
1180
|
-
*/
|
|
1181
|
-
s(this, "_emitterLife");
|
|
1182
|
-
/**
|
|
1183
|
-
* The particles that are active and on the display list. This is the first particle in a
|
|
1184
|
-
* linked list.
|
|
1185
|
-
*/
|
|
1186
|
-
s(this, "_activeParticlesFirst");
|
|
1187
|
-
/**
|
|
1188
|
-
* The particles that are active and on the display list. This is the last particle in a
|
|
1189
|
-
* linked list.
|
|
1190
|
-
*/
|
|
1191
|
-
s(this, "_activeParticlesLast");
|
|
1192
|
-
/**
|
|
1193
|
-
* The particles that are not currently being used. This is the first particle in a
|
|
1194
|
-
* linked list.
|
|
1195
|
-
*/
|
|
1196
|
-
s(this, "_poolFirst");
|
|
1197
|
-
/**
|
|
1198
|
-
* The original config object that this emitter was initialized with.
|
|
1199
|
-
*/
|
|
1200
|
-
s(this, "_origConfig");
|
|
1201
|
-
/**
|
|
1202
|
-
* If the update function is called automatically from the shared ticker.
|
|
1203
|
-
* Setting this to false requires calling the update function manually.
|
|
1257
|
+
* The first property node in the linked list.
|
|
1204
1258
|
*/
|
|
1205
|
-
s(this, "
|
|
1259
|
+
s(this, "first");
|
|
1206
1260
|
/**
|
|
1207
|
-
*
|
|
1261
|
+
* Calculates the correct value for the current interpolation value. This method is set in
|
|
1262
|
+
* the reset() method.
|
|
1263
|
+
* @param lerp The interpolation value from 0-1.
|
|
1264
|
+
* @return The interpolated value. Colors are converted to the hex value.
|
|
1208
1265
|
*/
|
|
1209
|
-
s(this, "
|
|
1266
|
+
s(this, "interpolate");
|
|
1210
1267
|
/**
|
|
1211
|
-
*
|
|
1212
|
-
*
|
|
1268
|
+
* A custom easing method for this list.
|
|
1269
|
+
* @param lerp The interpolation value from 0-1.
|
|
1270
|
+
* @return The eased value, also from 0-1.
|
|
1213
1271
|
*/
|
|
1214
|
-
s(this, "
|
|
1272
|
+
s(this, "ease");
|
|
1215
1273
|
/**
|
|
1216
|
-
*
|
|
1217
|
-
* playOnceAndDestroy() or playOnce();
|
|
1274
|
+
* If this list manages colors, which requires a different method for interpolation.
|
|
1218
1275
|
*/
|
|
1219
|
-
s(this, "
|
|
1220
|
-
this.
|
|
1221
|
-
}
|
|
1222
|
-
/**
|
|
1223
|
-
* Registers a new behavior, so that it will be recognized when initializing emitters.
|
|
1224
|
-
* Behaviors registered later with duplicate types will override older ones, although there is no limit on
|
|
1225
|
-
* the allowed types.
|
|
1226
|
-
* @param constructor The behavior class to register.
|
|
1227
|
-
*/
|
|
1228
|
-
static registerBehavior(t) {
|
|
1229
|
-
M.knownBehaviors[t.type] = t;
|
|
1276
|
+
s(this, "isColor");
|
|
1277
|
+
this.first = null, this.isColor = !!t, this.interpolate = null, this.ease = null;
|
|
1230
1278
|
}
|
|
1231
1279
|
/**
|
|
1232
|
-
*
|
|
1233
|
-
*
|
|
1280
|
+
* Resets the list for use.
|
|
1281
|
+
* @param first The first node in the list.
|
|
1282
|
+
* @param first.isStepped If the values should be stepped instead of interpolated linearly.
|
|
1234
1283
|
*/
|
|
1235
|
-
|
|
1236
|
-
|
|
1284
|
+
reset(t) {
|
|
1285
|
+
this.first = t, t.next && t.next.time >= 1 ? this.interpolate = this.isColor ? Mt : Lt : t.isStepped ? this.interpolate = this.isColor ? Bt : Tt : this.interpolate = this.isColor ? Ft : Et, this.ease = this.first.ease;
|
|
1237
1286
|
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1287
|
+
}
|
|
1288
|
+
class V {
|
|
1289
|
+
constructor(t) {
|
|
1290
|
+
s(this, "order", p.Normal);
|
|
1291
|
+
s(this, "list");
|
|
1292
|
+
this.list = new R(!1), this.list.reset(P.createList(t.alpha));
|
|
1240
1293
|
}
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
return this._parent;
|
|
1294
|
+
initParticles(t) {
|
|
1295
|
+
let e = t;
|
|
1296
|
+
for (; e; )
|
|
1297
|
+
e.alpha = this.list.first.value, e = e.next;
|
|
1246
1298
|
}
|
|
1247
|
-
|
|
1248
|
-
this.
|
|
1249
|
-
const e = t instanceof xt;
|
|
1250
|
-
e !== this._isParticleContainer && (this._poolFirst = null), this._isParticleContainer = e, this._parent = t;
|
|
1299
|
+
updateParticle(t) {
|
|
1300
|
+
t.alpha = this.list.interpolate(t.agePercent);
|
|
1251
1301
|
}
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1302
|
+
}
|
|
1303
|
+
s(V, "type", "alpha"), s(V, "editorConfig", null);
|
|
1304
|
+
class q {
|
|
1305
|
+
constructor(t) {
|
|
1306
|
+
s(this, "order", p.Normal);
|
|
1307
|
+
s(this, "value");
|
|
1308
|
+
this.value = t.alpha;
|
|
1257
1309
|
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
this._isParticleContainer ? this._parent.addParticle(t) : this.addAtBack ? this._parent.addChildAt(t, 0) : this._parent.addChild(t);
|
|
1310
|
+
initParticles(t) {
|
|
1311
|
+
let e = t;
|
|
1312
|
+
for (; e; )
|
|
1313
|
+
e.alpha = this.value, e = e.next;
|
|
1263
1314
|
}
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1315
|
+
}
|
|
1316
|
+
s(q, "type", "alphaStatic"), s(q, "editorConfig", null);
|
|
1317
|
+
function ht(i) {
|
|
1318
|
+
const t = [];
|
|
1319
|
+
for (let e = 0; e < i.length; ++e) {
|
|
1320
|
+
let a = i[e];
|
|
1321
|
+
if (typeof a == "string")
|
|
1322
|
+
t.push(F(a));
|
|
1323
|
+
else if (a instanceof B)
|
|
1324
|
+
t.push(a);
|
|
1325
|
+
else {
|
|
1326
|
+
let r = a.count || 1;
|
|
1327
|
+
for (typeof a.texture == "string" ? a = F(a.texture) : a = a.texture; r > 0; --r)
|
|
1328
|
+
t.push(a);
|
|
1329
|
+
}
|
|
1279
1330
|
}
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1331
|
+
return t;
|
|
1332
|
+
}
|
|
1333
|
+
class N {
|
|
1334
|
+
constructor(t) {
|
|
1335
|
+
s(this, "order", p.Normal);
|
|
1336
|
+
s(this, "anims");
|
|
1337
|
+
this.anims = [];
|
|
1338
|
+
for (let e = 0; e < t.anims.length; ++e) {
|
|
1339
|
+
const a = t.anims[e], r = ht(a.textures), l = a.framerate < 0 ? -1 : a.framerate > 0 ? a.framerate : 60, n = {
|
|
1340
|
+
textures: r,
|
|
1341
|
+
duration: l > 0 ? r.length / l : 0,
|
|
1342
|
+
framerate: l,
|
|
1343
|
+
loop: l > 0 ? !!a.loop : !1
|
|
1344
|
+
};
|
|
1345
|
+
this.anims.push(n);
|
|
1346
|
+
}
|
|
1286
1347
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
for (; t > 0; --t) {
|
|
1293
|
-
const e = this._createParticle();
|
|
1294
|
-
e.next = this._poolFirst, this._poolFirst = e;
|
|
1348
|
+
initParticles(t) {
|
|
1349
|
+
let e = t;
|
|
1350
|
+
for (; e; ) {
|
|
1351
|
+
const a = Math.floor(Math.random() * this.anims.length), r = e.config.anim = this.anims[a];
|
|
1352
|
+
e.texture = r.textures[0], e.config.animElapsed = 0, r.framerate === -1 ? (e.config.animDuration = e.maxLife, e.config.animFramerate = r.textures.length / e.maxLife) : (e.config.animDuration = r.duration, e.config.animFramerate = r.framerate), e = e.next;
|
|
1295
1353
|
}
|
|
1296
1354
|
}
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
*/
|
|
1303
|
-
recycle(t, e = !1) {
|
|
1304
|
-
var a;
|
|
1305
|
-
for (let r = 0; r < this.recycleBehaviors.length; ++r)
|
|
1306
|
-
this.recycleBehaviors[r].recycleParticle(t, !e);
|
|
1307
|
-
t.next && (t.next.prev = t.prev), t.prev && (t.prev.next = t.next), t === this._activeParticlesLast && (this._activeParticlesLast = t.prev), t === this._activeParticlesFirst && (this._activeParticlesFirst = t.next), t.prev = null, t.next = this._poolFirst, this._poolFirst = t, this._isParticleContainer ? (a = this._parent) == null || a.removeParticle(t) : t.parent && t.parent.removeChild(t), --this.particleCount;
|
|
1355
|
+
updateParticle(t, e) {
|
|
1356
|
+
const { config: a } = t, { anim: r } = a;
|
|
1357
|
+
a.animElapsed += e, a.animElapsed >= a.animDuration && (a.anim.loop ? a.animElapsed = a.animElapsed % a.animDuration : a.animElapsed = a.animDuration - 1e-6);
|
|
1358
|
+
const l = a.animElapsed * a.animFramerate + 1e-7 | 0;
|
|
1359
|
+
t.texture = r.textures[l] || r.textures[r.textures.length - 1] || B.EMPTY;
|
|
1308
1360
|
}
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1361
|
+
}
|
|
1362
|
+
s(N, "type", "animatedRandom"), s(N, "editorConfig", null);
|
|
1363
|
+
class U {
|
|
1364
|
+
constructor(t) {
|
|
1365
|
+
s(this, "order", p.Normal);
|
|
1366
|
+
s(this, "anim");
|
|
1367
|
+
const { anim: e } = t, a = ht(e.textures), r = e.framerate < 0 ? -1 : e.framerate > 0 ? e.framerate : 60;
|
|
1368
|
+
this.anim = {
|
|
1369
|
+
textures: a,
|
|
1370
|
+
duration: r > 0 ? a.length / r : 0,
|
|
1371
|
+
framerate: r,
|
|
1372
|
+
loop: r > 0 ? !!e.loop : !1
|
|
1373
|
+
};
|
|
1318
1374
|
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
updateSpawnPos(t, e) {
|
|
1325
|
-
this._posChanged = !0, this.spawnPos.x = t, this.spawnPos.y = e;
|
|
1375
|
+
initParticles(t) {
|
|
1376
|
+
let e = t;
|
|
1377
|
+
const { anim: a } = this;
|
|
1378
|
+
for (; e; )
|
|
1379
|
+
e.texture = a.textures[0], e.config.animElapsed = 0, a.framerate === -1 ? (e.config.animDuration = e.maxLife, e.config.animFramerate = a.textures.length / e.maxLife) : (e.config.animDuration = a.duration, e.config.animFramerate = a.framerate), e = e.next;
|
|
1326
1380
|
}
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1381
|
+
updateParticle(t, e) {
|
|
1382
|
+
const { anim: a } = this, { config: r } = t;
|
|
1383
|
+
r.animElapsed += e, r.animElapsed >= r.animDuration && (a.loop ? r.animElapsed = r.animElapsed % r.animDuration : r.animElapsed = r.animDuration - 1e-6);
|
|
1384
|
+
const l = r.animElapsed * r.animFramerate + 1e-7 | 0;
|
|
1385
|
+
t.texture = a.textures[l] || a.textures[a.textures.length - 1] || B.EMPTY;
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
s(U, "type", "animatedSingle"), s(U, "editorConfig", null);
|
|
1389
|
+
class W {
|
|
1390
|
+
constructor(t) {
|
|
1391
|
+
s(this, "order", p.Normal);
|
|
1392
|
+
s(this, "value");
|
|
1393
|
+
this.value = t.blendMode;
|
|
1394
|
+
}
|
|
1395
|
+
initParticles(t) {
|
|
1396
|
+
let e = t;
|
|
1397
|
+
for (; e; )
|
|
1398
|
+
e.blendMode = ot(this.value), e = e.next;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
s(W, "type", "blendMode"), s(W, "editorConfig", null);
|
|
1402
|
+
class Y {
|
|
1403
|
+
constructor(t) {
|
|
1404
|
+
s(this, "order", p.Spawn);
|
|
1405
|
+
s(this, "spacing");
|
|
1406
|
+
s(this, "start");
|
|
1407
|
+
s(this, "distance");
|
|
1408
|
+
this.spacing = t.spacing * _, this.start = t.start * _, this.distance = t.distance;
|
|
1335
1409
|
}
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
this._prevPosIsValid = !1;
|
|
1410
|
+
initParticles(t) {
|
|
1411
|
+
let e = 0, a = t;
|
|
1412
|
+
for (; a; ) {
|
|
1413
|
+
let r;
|
|
1414
|
+
this.spacing ? r = this.start + this.spacing * e : r = Math.random() * Math.PI * 2, a.rotation = r, this.distance && (a.position.x = this.distance, w(r, a.position)), a = a.next, ++e;
|
|
1415
|
+
}
|
|
1343
1416
|
}
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1417
|
+
}
|
|
1418
|
+
s(Y, "type", "spawnBurst"), s(Y, "editorConfig", null);
|
|
1419
|
+
class D {
|
|
1420
|
+
constructor(t) {
|
|
1421
|
+
s(this, "order", p.Normal);
|
|
1422
|
+
s(this, "list");
|
|
1423
|
+
this.list = new R(!0), this.list.reset(P.createList(t.color));
|
|
1350
1424
|
}
|
|
1351
|
-
|
|
1352
|
-
|
|
1425
|
+
initParticles(t) {
|
|
1426
|
+
let e = t;
|
|
1427
|
+
const a = this.list.first.value, r = k(a.r, a.g, a.b);
|
|
1428
|
+
for (; e; )
|
|
1429
|
+
e.tint = r, e = e.next;
|
|
1353
1430
|
}
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
* Setting this to false requires calling the update function manually.
|
|
1357
|
-
*/
|
|
1358
|
-
get autoUpdate() {
|
|
1359
|
-
return this._autoUpdate;
|
|
1431
|
+
updateParticle(t) {
|
|
1432
|
+
t.tint = this.list.interpolate(t.agePercent);
|
|
1360
1433
|
}
|
|
1361
|
-
|
|
1362
|
-
|
|
1434
|
+
}
|
|
1435
|
+
s(D, "type", "color"), s(D, "editorConfig", null);
|
|
1436
|
+
class X {
|
|
1437
|
+
constructor(t) {
|
|
1438
|
+
s(this, "order", p.Normal);
|
|
1439
|
+
s(this, "value");
|
|
1440
|
+
let { color: e } = t;
|
|
1441
|
+
e.charAt(0) === "#" ? e = e.substr(1) : e.indexOf("0x") === 0 && (e = e.substr(2)), this.value = parseInt(e, 16);
|
|
1363
1442
|
}
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
*/
|
|
1369
|
-
playOnceAndDestroy(t) {
|
|
1370
|
-
this.autoUpdate = !0, this.emit = !0, this._destroyWhenComplete = !0, this._completeCallback = t;
|
|
1443
|
+
initParticles(t) {
|
|
1444
|
+
let e = t;
|
|
1445
|
+
for (; e; )
|
|
1446
|
+
e.tint = this.value, e = e.next;
|
|
1371
1447
|
}
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
this
|
|
1448
|
+
}
|
|
1449
|
+
s(X, "type", "colorStatic"), s(X, "editorConfig", null);
|
|
1450
|
+
class j {
|
|
1451
|
+
constructor(t) {
|
|
1452
|
+
s(this, "order", p.Normal);
|
|
1453
|
+
s(this, "textures");
|
|
1454
|
+
s(this, "index");
|
|
1455
|
+
this.index = 0, this.textures = t.textures.map((e) => typeof e == "string" ? F(e) : e);
|
|
1378
1456
|
}
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
update(t) {
|
|
1384
|
-
if (typeof t != "number" && (t = t.deltaMS * 1e-3), this._autoUpdate && (t = st.elapsedMS * 1e-3), !this._parent) return;
|
|
1385
|
-
for (let n = this._activeParticlesFirst, o; n; n = o)
|
|
1386
|
-
if (o = n.next, n.age += t, n.age > n.maxLife || n.age < 0)
|
|
1387
|
-
this.recycle(n);
|
|
1388
|
-
else {
|
|
1389
|
-
let c = n.age * n.oneOverLife;
|
|
1390
|
-
this.customEase && (this.customEase.length === 4 ? c = this.customEase(c, 0, 1, 1) : c = this.customEase(c)), n.agePercent = c;
|
|
1391
|
-
for (let u = 0; u < this.updateBehaviors.length; ++u)
|
|
1392
|
-
if (this.updateBehaviors[u].updateParticle(n, t)) {
|
|
1393
|
-
this.recycle(n);
|
|
1394
|
-
break;
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
let e, a;
|
|
1398
|
-
this._prevPosIsValid && (e = this._prevEmitterPos.x, a = this._prevEmitterPos.y);
|
|
1399
|
-
const r = this.ownerPos.x + this.spawnPos.x, l = this.ownerPos.y + this.spawnPos.y;
|
|
1400
|
-
if (this._emit)
|
|
1401
|
-
for (this._spawnTimer -= t < 0 ? 0 : t; this._spawnTimer <= 0; ) {
|
|
1402
|
-
if (this._emitterLife >= 0 && (this._emitterLife -= this._frequency, this._emitterLife <= 0)) {
|
|
1403
|
-
this._spawnTimer = 0, this._emitterLife = 0, this.emit = !1;
|
|
1404
|
-
break;
|
|
1405
|
-
}
|
|
1406
|
-
if (this.particleCount >= this.maxParticles) {
|
|
1407
|
-
this._spawnTimer += this._frequency;
|
|
1408
|
-
continue;
|
|
1409
|
-
}
|
|
1410
|
-
let n, o;
|
|
1411
|
-
if (this._prevPosIsValid && this._posChanged) {
|
|
1412
|
-
const d = 1 + this._spawnTimer / t;
|
|
1413
|
-
n = (r - e) * d + e, o = (l - a) * d + a;
|
|
1414
|
-
} else
|
|
1415
|
-
n = r, o = l;
|
|
1416
|
-
let c = null, u = null;
|
|
1417
|
-
for (let d = Math.min(this.particlesPerWave, this.maxParticles - this.particleCount), y = 0; y < d; ++y) {
|
|
1418
|
-
if (this.spawnChance < 1 && Math.random() >= this.spawnChance)
|
|
1419
|
-
continue;
|
|
1420
|
-
let f;
|
|
1421
|
-
if (this.minLifetime === this.maxLifetime ? f = this.minLifetime : f = Math.random() * (this.maxLifetime - this.minLifetime) + this.minLifetime, -this._spawnTimer >= f)
|
|
1422
|
-
continue;
|
|
1423
|
-
let x;
|
|
1424
|
-
this._poolFirst ? (x = this._poolFirst, this._poolFirst = this._poolFirst.next, x.next = null) : x = this._createParticle(), x.init(f), this._addParticleToParent(x), c ? (u.next = x, x.prev = u, u = x) : u = c = x, ++this.particleCount;
|
|
1425
|
-
}
|
|
1426
|
-
if (c) {
|
|
1427
|
-
this._activeParticlesLast ? (this._activeParticlesLast.next = c, c.prev = this._activeParticlesLast, this._activeParticlesLast = u) : (this._activeParticlesFirst = c, this._activeParticlesLast = u);
|
|
1428
|
-
for (let d = 0; d < this.initBehaviors.length; ++d) {
|
|
1429
|
-
const y = this.initBehaviors[d];
|
|
1430
|
-
if (y === b)
|
|
1431
|
-
for (let f = c, x; f; f = x) {
|
|
1432
|
-
x = f.next, this.rotation !== 0 && (w(this.rotation, f.position), f.rotation += this.rotation), f.position.x += n, f.position.y += o, f.age += -this._spawnTimer;
|
|
1433
|
-
let h = f.age * f.oneOverLife;
|
|
1434
|
-
this.customEase && (this.customEase.length === 4 ? h = this.customEase(h, 0, 1, 1) : h = this.customEase(h)), f.agePercent = h;
|
|
1435
|
-
}
|
|
1436
|
-
else
|
|
1437
|
-
y.initParticles(c);
|
|
1438
|
-
}
|
|
1439
|
-
for (let d = c, y; d; d = y) {
|
|
1440
|
-
y = d.next;
|
|
1441
|
-
for (let f = 0; f < this.updateBehaviors.length; ++f)
|
|
1442
|
-
if (this.updateBehaviors[f].updateParticle(d, -this._spawnTimer)) {
|
|
1443
|
-
this.recycle(d);
|
|
1444
|
-
break;
|
|
1445
|
-
}
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
this._spawnTimer += this._frequency;
|
|
1449
|
-
}
|
|
1450
|
-
if (this._posChanged && (this._prevEmitterPos.x = r, this._prevEmitterPos.y = l, this._prevPosIsValid = !0, this._posChanged = !1), !this._emit && !this._activeParticlesFirst) {
|
|
1451
|
-
if (this._completeCallback) {
|
|
1452
|
-
const n = this._completeCallback;
|
|
1453
|
-
this._completeCallback = null, n();
|
|
1454
|
-
}
|
|
1455
|
-
this._destroyWhenComplete && this.destroy();
|
|
1456
|
-
}
|
|
1457
|
+
initParticles(t) {
|
|
1458
|
+
let e = t;
|
|
1459
|
+
for (; e; )
|
|
1460
|
+
e.texture = this.textures[this.index], ++this.index >= this.textures.length && (this.index = 0), e = e.next;
|
|
1457
1461
|
}
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1462
|
+
}
|
|
1463
|
+
s(j, "type", "textureOrdered"), s(j, "editorConfig", null);
|
|
1464
|
+
const E = new C(), ct = [
|
|
1465
|
+
"E",
|
|
1466
|
+
"LN2",
|
|
1467
|
+
"LN10",
|
|
1468
|
+
"LOG2E",
|
|
1469
|
+
"LOG10E",
|
|
1470
|
+
"PI",
|
|
1471
|
+
"SQRT1_2",
|
|
1472
|
+
"SQRT2",
|
|
1473
|
+
"abs",
|
|
1474
|
+
"acos",
|
|
1475
|
+
"acosh",
|
|
1476
|
+
"asin",
|
|
1477
|
+
"asinh",
|
|
1478
|
+
"atan",
|
|
1479
|
+
"atanh",
|
|
1480
|
+
"atan2",
|
|
1481
|
+
"cbrt",
|
|
1482
|
+
"ceil",
|
|
1483
|
+
"cos",
|
|
1484
|
+
"cosh",
|
|
1485
|
+
"exp",
|
|
1486
|
+
"expm1",
|
|
1487
|
+
"floor",
|
|
1488
|
+
"fround",
|
|
1489
|
+
"hypot",
|
|
1490
|
+
"log",
|
|
1491
|
+
"log1p",
|
|
1492
|
+
"log10",
|
|
1493
|
+
"log2",
|
|
1494
|
+
"max",
|
|
1495
|
+
"min",
|
|
1496
|
+
"pow",
|
|
1497
|
+
"random",
|
|
1498
|
+
"round",
|
|
1499
|
+
"sign",
|
|
1500
|
+
"sin",
|
|
1501
|
+
"sinh",
|
|
1502
|
+
"sqrt",
|
|
1503
|
+
"tan",
|
|
1504
|
+
"tanh"
|
|
1505
|
+
], kt = new RegExp(
|
|
1506
|
+
[
|
|
1507
|
+
// Allow the 4 basic operations, parentheses and all numbers/decimals, as well
|
|
1508
|
+
// as 'x', for the variable usage.
|
|
1509
|
+
"[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"
|
|
1510
|
+
].concat(ct).join("|"),
|
|
1511
|
+
"g"
|
|
1512
|
+
);
|
|
1513
|
+
function Rt(i) {
|
|
1514
|
+
const t = i.match(kt);
|
|
1515
|
+
for (let e = t.length - 1; e >= 0; --e)
|
|
1516
|
+
ct.indexOf(t[e]) >= 0 && (t[e] = `Math.${t[e]}`);
|
|
1517
|
+
return i = t.join(""), new Function("x", `return ${i};`);
|
|
1518
|
+
}
|
|
1519
|
+
class G {
|
|
1520
|
+
constructor(t) {
|
|
1521
|
+
// *MUST* happen after other behaviors do initialization so that we can read initial transformations
|
|
1522
|
+
s(this, "order", p.Late);
|
|
1523
|
+
/**
|
|
1524
|
+
* The function representing the path the particle should take.
|
|
1525
|
+
*/
|
|
1526
|
+
s(this, "path");
|
|
1527
|
+
s(this, "list");
|
|
1528
|
+
s(this, "minMult");
|
|
1529
|
+
if (t.path)
|
|
1530
|
+
if (typeof t.path == "function")
|
|
1531
|
+
this.path = t.path;
|
|
1532
|
+
else
|
|
1533
|
+
try {
|
|
1534
|
+
this.path = Rt(t.path);
|
|
1535
|
+
} catch {
|
|
1536
|
+
this.path = null;
|
|
1537
|
+
}
|
|
1538
|
+
else
|
|
1539
|
+
this.path = (e) => e;
|
|
1540
|
+
this.list = new R(!1), this.list.reset(P.createList(t.speed)), this.minMult = t.minMult ?? 1;
|
|
1541
|
+
}
|
|
1542
|
+
initParticles(t) {
|
|
1543
|
+
let e = t;
|
|
1544
|
+
for (; e; ) {
|
|
1545
|
+
e.config.initRotation = e.rotation, e.config.initPosition ? e.config.initPosition.copyFrom(e.position) : e.config.initPosition = new C(e.x, e.y), e.config.movement = 0;
|
|
1546
|
+
const a = Math.random() * (1 - this.minMult) + this.minMult;
|
|
1547
|
+
e.config.speedMult = a, e = e.next;
|
|
1484
1548
|
}
|
|
1485
1549
|
}
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
cleanup() {
|
|
1490
|
-
let t, e;
|
|
1491
|
-
for (t = this._activeParticlesFirst; t; t = e)
|
|
1492
|
-
e = t.next, this.recycle(t, !0);
|
|
1493
|
-
this._activeParticlesFirst = this._activeParticlesLast = null, this.particleCount = 0;
|
|
1550
|
+
updateParticle(t, e) {
|
|
1551
|
+
const a = this.list.interpolate(t.agePercent) * t.config.speedMult;
|
|
1552
|
+
t.config.movement += a * e, E.x = t.config.movement, E.y = this.path(E.x), w(t.config.initRotation, E), t.position.x = t.config.initPosition.x + E.x, t.position.y = t.config.initPosition.y + E.y;
|
|
1494
1553
|
}
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
return !(this._parent && this.initBehaviors.length);
|
|
1554
|
+
}
|
|
1555
|
+
s(G, "type", "movePath"), s(G, "editorConfig", null);
|
|
1556
|
+
class z {
|
|
1557
|
+
constructor() {
|
|
1558
|
+
s(this, "order", p.Spawn);
|
|
1501
1559
|
}
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
*/
|
|
1505
|
-
destroy() {
|
|
1506
|
-
this.autoUpdate = !1, this.cleanup();
|
|
1507
|
-
let t;
|
|
1508
|
-
for (let e = this._poolFirst; e; e = t)
|
|
1509
|
-
t = e.next, e.destroy();
|
|
1510
|
-
this._poolFirst = this._parent = this.spawnPos = this.ownerPos = this.customEase = this._completeCallback = null, this.initBehaviors.length = this.updateBehaviors.length = this.recycleBehaviors.length = 0;
|
|
1560
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1561
|
+
initParticles(t) {
|
|
1511
1562
|
}
|
|
1512
|
-
}
|
|
1513
|
-
s(
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
emitterLifetime: i.emitterLifetime,
|
|
1526
|
-
maxParticles: i.maxParticles,
|
|
1527
|
-
addAtBack: i.addAtBack,
|
|
1528
|
-
pos: i.pos,
|
|
1529
|
-
emit: i.emit,
|
|
1530
|
-
autoUpdate: i.autoUpdate,
|
|
1531
|
-
behaviors: []
|
|
1532
|
-
};
|
|
1533
|
-
if (i.alpha)
|
|
1534
|
-
if ("start" in i.alpha)
|
|
1535
|
-
if (i.alpha.start === i.alpha.end)
|
|
1536
|
-
i.alpha.start !== 1 && e.behaviors.push({
|
|
1537
|
-
type: "alphaStatic",
|
|
1538
|
-
config: { alpha: i.alpha.start }
|
|
1539
|
-
});
|
|
1540
|
-
else {
|
|
1541
|
-
const h = {
|
|
1542
|
-
list: [
|
|
1543
|
-
{ time: 0, value: i.alpha.start },
|
|
1544
|
-
{ time: 1, value: i.alpha.end }
|
|
1545
|
-
]
|
|
1546
|
-
};
|
|
1547
|
-
e.behaviors.push({
|
|
1548
|
-
type: "alpha",
|
|
1549
|
-
config: { alpha: h }
|
|
1550
|
-
});
|
|
1551
|
-
}
|
|
1552
|
-
else i.alpha.list.length === 1 ? i.alpha.list[0].value !== 1 && e.behaviors.push({
|
|
1553
|
-
type: "alphaStatic",
|
|
1554
|
-
config: { alpha: i.alpha.list[0].value }
|
|
1555
|
-
}) : e.behaviors.push({
|
|
1556
|
-
type: "alpha",
|
|
1557
|
-
config: { alpha: i.alpha }
|
|
1558
|
-
});
|
|
1559
|
-
if (i.acceleration && (i.acceleration.x || i.acceleration.y)) {
|
|
1560
|
-
let h, v;
|
|
1561
|
-
"start" in i.speed ? (h = i.speed.start * (i.speed.minimumSpeedMultiplier ?? 1), v = i.speed.start) : (h = i.speed.list[0].value * (i.minimumSpeedMultiplier ?? 1), v = i.speed.list[0].value), e.behaviors.push({
|
|
1562
|
-
type: "moveAcceleration",
|
|
1563
|
-
config: {
|
|
1564
|
-
accel: i.acceleration,
|
|
1565
|
-
minStart: h,
|
|
1566
|
-
maxStart: v,
|
|
1567
|
-
rotate: !i.noRotation,
|
|
1568
|
-
maxSpeed: i.maxSpeed
|
|
1569
|
-
}
|
|
1570
|
-
});
|
|
1571
|
-
} else if ((a = i.extraData) != null && a.path) {
|
|
1572
|
-
let h, v;
|
|
1573
|
-
"start" in i.speed ? (v = i.speed.minimumSpeedMultiplier ?? 1, i.speed.start === i.speed.end ? h = {
|
|
1574
|
-
list: [{ time: 0, value: i.speed.start }]
|
|
1575
|
-
} : h = {
|
|
1576
|
-
list: [
|
|
1577
|
-
{ time: 0, value: i.speed.start },
|
|
1578
|
-
{ time: 1, value: i.speed.end }
|
|
1579
|
-
]
|
|
1580
|
-
}) : (h = i.speed, v = i.minimumSpeedMultiplier ?? 1), e.behaviors.push({
|
|
1581
|
-
type: "movePath",
|
|
1582
|
-
config: {
|
|
1583
|
-
path: i.extraData.path,
|
|
1584
|
-
speed: h,
|
|
1585
|
-
minMult: v
|
|
1586
|
-
}
|
|
1587
|
-
});
|
|
1588
|
-
} else if (i.speed)
|
|
1589
|
-
if ("start" in i.speed)
|
|
1590
|
-
if (i.speed.start === i.speed.end)
|
|
1591
|
-
e.behaviors.push({
|
|
1592
|
-
type: "moveSpeedStatic",
|
|
1593
|
-
config: {
|
|
1594
|
-
min: i.speed.start * (i.speed.minimumSpeedMultiplier ?? 1),
|
|
1595
|
-
max: i.speed.start
|
|
1596
|
-
}
|
|
1597
|
-
});
|
|
1598
|
-
else {
|
|
1599
|
-
const h = {
|
|
1600
|
-
list: [
|
|
1601
|
-
{ time: 0, value: i.speed.start },
|
|
1602
|
-
{ time: 1, value: i.speed.end }
|
|
1603
|
-
]
|
|
1604
|
-
};
|
|
1605
|
-
e.behaviors.push({
|
|
1606
|
-
type: "moveSpeed",
|
|
1607
|
-
config: { speed: h, minMult: i.speed.minimumSpeedMultiplier }
|
|
1608
|
-
});
|
|
1609
|
-
}
|
|
1610
|
-
else i.speed.list.length === 1 ? e.behaviors.push({
|
|
1611
|
-
type: "moveSpeedStatic",
|
|
1612
|
-
config: {
|
|
1613
|
-
min: i.speed.list[0].value * (i.minimumSpeedMultiplier ?? 1),
|
|
1614
|
-
max: i.speed.list[0].value
|
|
1615
|
-
}
|
|
1616
|
-
}) : e.behaviors.push({
|
|
1617
|
-
type: "moveSpeed",
|
|
1618
|
-
config: { speed: i.speed, minMult: i.minimumSpeedMultiplier ?? 1 }
|
|
1619
|
-
});
|
|
1620
|
-
if (i.scale)
|
|
1621
|
-
if ("start" in i.scale) {
|
|
1622
|
-
const h = i.scale.minimumScaleMultiplier ?? 1;
|
|
1623
|
-
if (i.scale.start === i.scale.end)
|
|
1624
|
-
e.behaviors.push({
|
|
1625
|
-
type: "scaleStatic",
|
|
1626
|
-
config: {
|
|
1627
|
-
min: i.scale.start * h,
|
|
1628
|
-
max: i.scale.start
|
|
1629
|
-
}
|
|
1630
|
-
});
|
|
1631
|
-
else {
|
|
1632
|
-
const v = {
|
|
1633
|
-
list: [
|
|
1634
|
-
{ time: 0, value: i.scale.start },
|
|
1635
|
-
{ time: 1, value: i.scale.end }
|
|
1636
|
-
]
|
|
1637
|
-
};
|
|
1638
|
-
e.behaviors.push({
|
|
1639
|
-
type: "scale",
|
|
1640
|
-
config: { scale: v, minMult: h }
|
|
1641
|
-
});
|
|
1642
|
-
}
|
|
1643
|
-
} else if (i.scale.list.length === 1) {
|
|
1644
|
-
const h = i.minimumScaleMultiplier ?? 1, v = i.scale.list[0].value;
|
|
1645
|
-
e.behaviors.push({
|
|
1646
|
-
type: "scaleStatic",
|
|
1647
|
-
config: { min: v * h, max: v }
|
|
1648
|
-
});
|
|
1649
|
-
} else
|
|
1650
|
-
e.behaviors.push({
|
|
1651
|
-
type: "scale",
|
|
1652
|
-
config: { scale: i.scale, minMult: i.minimumScaleMultiplier ?? 1 }
|
|
1653
|
-
});
|
|
1654
|
-
if (i.color)
|
|
1655
|
-
if ("start" in i.color)
|
|
1656
|
-
if (i.color.start === i.color.end)
|
|
1657
|
-
i.color.start !== "ffffff" && e.behaviors.push({
|
|
1658
|
-
type: "colorStatic",
|
|
1659
|
-
config: { color: i.color.start }
|
|
1660
|
-
});
|
|
1661
|
-
else {
|
|
1662
|
-
const h = {
|
|
1663
|
-
list: [
|
|
1664
|
-
{ time: 0, value: i.color.start },
|
|
1665
|
-
{ time: 1, value: i.color.end }
|
|
1666
|
-
]
|
|
1667
|
-
};
|
|
1668
|
-
e.behaviors.push({
|
|
1669
|
-
type: "color",
|
|
1670
|
-
config: { color: h }
|
|
1671
|
-
});
|
|
1672
|
-
}
|
|
1673
|
-
else i.color.list.length === 1 ? i.color.list[0].value !== "ffffff" && e.behaviors.push({
|
|
1674
|
-
type: "colorStatic",
|
|
1675
|
-
config: { color: i.color.list[0].value }
|
|
1676
|
-
}) : e.behaviors.push({
|
|
1677
|
-
type: "color",
|
|
1678
|
-
config: { color: i.color }
|
|
1679
|
-
});
|
|
1680
|
-
if (i.rotationAcceleration || (r = i.rotationSpeed) != null && r.min || (l = i.rotationSpeed) != null && l.max ? e.behaviors.push({
|
|
1681
|
-
type: "rotation",
|
|
1682
|
-
config: {
|
|
1683
|
-
accel: i.rotationAcceleration || 0,
|
|
1684
|
-
minSpeed: ((n = i.rotationSpeed) == null ? void 0 : n.min) || 0,
|
|
1685
|
-
maxSpeed: ((o = i.rotationSpeed) == null ? void 0 : o.max) || 0,
|
|
1686
|
-
minStart: ((c = i.startRotation) == null ? void 0 : c.min) || 0,
|
|
1687
|
-
maxStart: ((u = i.startRotation) == null ? void 0 : u.max) || 0
|
|
1688
|
-
}
|
|
1689
|
-
}) : ((d = i.startRotation) != null && d.min || (y = i.startRotation) != null && y.max) && e.behaviors.push({
|
|
1690
|
-
type: "rotationStatic",
|
|
1691
|
-
config: {
|
|
1692
|
-
min: ((f = i.startRotation) == null ? void 0 : f.min) || 0,
|
|
1693
|
-
max: ((x = i.startRotation) == null ? void 0 : x.max) || 0
|
|
1694
|
-
}
|
|
1695
|
-
}), i.noRotation && e.behaviors.push({
|
|
1696
|
-
type: "noRotation",
|
|
1697
|
-
config: {}
|
|
1698
|
-
}), i.blendMode && i.blendMode !== "normal" && e.behaviors.push({
|
|
1699
|
-
type: "blendMode",
|
|
1700
|
-
config: {
|
|
1701
|
-
blendMode: i.blendMode
|
|
1702
|
-
}
|
|
1703
|
-
}), Array.isArray(t) && typeof t[0] != "string" && "framerate" in t[0]) {
|
|
1704
|
-
for (let h = 0; h < t.length; ++h)
|
|
1705
|
-
t[h].framerate === "matchLife" && (t[h].framerate = -1);
|
|
1706
|
-
e.behaviors.push({
|
|
1707
|
-
type: "animatedRandom",
|
|
1708
|
-
config: {
|
|
1709
|
-
anims: t
|
|
1710
|
-
}
|
|
1711
|
-
});
|
|
1712
|
-
} else typeof t != "string" && "framerate" in t ? (t.framerate === "matchLife" && (t.framerate = -1), e.behaviors.push({
|
|
1713
|
-
type: "animatedSingle",
|
|
1714
|
-
config: {
|
|
1715
|
-
anim: t
|
|
1563
|
+
}
|
|
1564
|
+
s(z, "type", "spawnPoint"), s(z, "editorConfig", null);
|
|
1565
|
+
class $ {
|
|
1566
|
+
constructor(t) {
|
|
1567
|
+
s(this, "order", p.Normal);
|
|
1568
|
+
s(this, "textures");
|
|
1569
|
+
this.textures = t.textures.map((e) => typeof e == "string" ? F(e) : e);
|
|
1570
|
+
}
|
|
1571
|
+
initParticles(t) {
|
|
1572
|
+
let e = t;
|
|
1573
|
+
for (; e; ) {
|
|
1574
|
+
const a = Math.floor(Math.random() * this.textures.length);
|
|
1575
|
+
e.texture = this.textures[a], e = e.next;
|
|
1716
1576
|
}
|
|
1717
|
-
}
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
s($, "type", "textureRandom"), s($, "editorConfig", null);
|
|
1580
|
+
class Q {
|
|
1581
|
+
constructor(t) {
|
|
1582
|
+
s(this, "order", p.Normal);
|
|
1583
|
+
s(this, "minStart");
|
|
1584
|
+
s(this, "maxStart");
|
|
1585
|
+
s(this, "minSpeed");
|
|
1586
|
+
s(this, "maxSpeed");
|
|
1587
|
+
s(this, "accel");
|
|
1588
|
+
this.minStart = t.minStart * _, this.maxStart = t.maxStart * _, this.minSpeed = t.minSpeed * _, this.maxSpeed = t.maxSpeed * _, this.accel = t.accel * _;
|
|
1589
|
+
}
|
|
1590
|
+
initParticles(t) {
|
|
1591
|
+
let e = t;
|
|
1592
|
+
for (; e; )
|
|
1593
|
+
this.minStart === this.maxStart ? e.rotation += this.maxStart : e.rotation += Math.random() * (this.maxStart - this.minStart) + this.minStart, e.config.rotSpeed = Math.random() * (this.maxSpeed - this.minSpeed) + this.minSpeed, e = e.next;
|
|
1594
|
+
}
|
|
1595
|
+
updateParticle(t, e) {
|
|
1596
|
+
if (this.accel) {
|
|
1597
|
+
const a = t.config.rotSpeed;
|
|
1598
|
+
t.config.rotSpeed += this.accel * e, t.rotation += (t.config.rotSpeed + a) / 2 * e;
|
|
1599
|
+
} else
|
|
1600
|
+
t.rotation += t.config.rotSpeed * e;
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
s(Q, "type", "rotation"), s(Q, "editorConfig", null);
|
|
1604
|
+
class H {
|
|
1605
|
+
constructor(t) {
|
|
1606
|
+
s(this, "order", p.Normal);
|
|
1607
|
+
s(this, "min");
|
|
1608
|
+
s(this, "max");
|
|
1609
|
+
this.min = t.min * _, this.max = t.max * _;
|
|
1610
|
+
}
|
|
1611
|
+
initParticles(t) {
|
|
1612
|
+
let e = t;
|
|
1613
|
+
for (; e; )
|
|
1614
|
+
this.min === this.max ? e.rotation += this.max : e.rotation += Math.random() * (this.max - this.min) + this.min, e = e.next;
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
s(H, "type", "rotationStatic"), s(H, "editorConfig", null);
|
|
1618
|
+
class J {
|
|
1619
|
+
constructor(t) {
|
|
1620
|
+
s(this, "order", p.Late + 1);
|
|
1621
|
+
s(this, "rotation");
|
|
1622
|
+
this.rotation = (t.rotation || 0) * _;
|
|
1623
|
+
}
|
|
1624
|
+
initParticles(t) {
|
|
1625
|
+
let e = t;
|
|
1626
|
+
for (; e; )
|
|
1627
|
+
e.rotation = this.rotation, e = e.next;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
s(J, "type", "noRotation"), s(J, "editorConfig", null);
|
|
1631
|
+
class K {
|
|
1632
|
+
constructor(t) {
|
|
1633
|
+
s(this, "order", p.Normal);
|
|
1634
|
+
s(this, "list");
|
|
1635
|
+
s(this, "minMult");
|
|
1636
|
+
this.list = new R(!1), this.list.reset(P.createList(t.scale)), this.minMult = t.minMult ?? 1;
|
|
1637
|
+
}
|
|
1638
|
+
initParticles(t) {
|
|
1639
|
+
let e = t;
|
|
1640
|
+
for (; e; ) {
|
|
1641
|
+
const a = Math.random() * (1 - this.minMult) + this.minMult;
|
|
1642
|
+
e.config.scaleMult = a, e.scale.x = e.scale.y = this.list.first.value * a, e = e.next;
|
|
1721
1643
|
}
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1724
|
-
config
|
|
1725
|
-
|
|
1644
|
+
}
|
|
1645
|
+
updateParticle(t) {
|
|
1646
|
+
t.scale.x = t.scale.y = this.list.interpolate(t.agePercent) * t.config.scaleMult;
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
s(K, "type", "scale"), s(K, "editorConfig", null);
|
|
1650
|
+
class Z {
|
|
1651
|
+
constructor(t) {
|
|
1652
|
+
s(this, "order", p.Normal);
|
|
1653
|
+
s(this, "min");
|
|
1654
|
+
s(this, "max");
|
|
1655
|
+
this.min = t.min, this.max = t.max;
|
|
1656
|
+
}
|
|
1657
|
+
initParticles(t) {
|
|
1658
|
+
let e = t;
|
|
1659
|
+
for (; e; ) {
|
|
1660
|
+
const a = Math.random() * (this.max - this.min) + this.min;
|
|
1661
|
+
e.scale.x = e.scale.y = a, e = e.next;
|
|
1726
1662
|
}
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
s(Z, "type", "scaleStatic"), s(Z, "editorConfig", null);
|
|
1666
|
+
const M = class M {
|
|
1667
|
+
constructor(t) {
|
|
1668
|
+
s(this, "order", p.Spawn);
|
|
1669
|
+
s(this, "shape");
|
|
1670
|
+
const e = M.shapes[t.type];
|
|
1671
|
+
if (!e)
|
|
1672
|
+
throw new Error(`No shape found with type '${t.type}'`);
|
|
1673
|
+
this.shape = new e(t.data);
|
|
1674
|
+
}
|
|
1675
|
+
/**
|
|
1676
|
+
* Registers a shape to be used by the ShapeSpawn behavior.
|
|
1677
|
+
* @param constructor The shape class constructor to use, with a static `type` property to reference it by.
|
|
1678
|
+
* @param typeOverride An optional type override, primarily for registering a shape under multiple names.
|
|
1679
|
+
*/
|
|
1680
|
+
static registerShape(t, e) {
|
|
1681
|
+
M.shapes[e || t.type] = t;
|
|
1682
|
+
}
|
|
1683
|
+
initParticles(t) {
|
|
1684
|
+
let e = t;
|
|
1685
|
+
for (; e; )
|
|
1686
|
+
this.shape.getRandPos(e), e = e.next;
|
|
1687
|
+
}
|
|
1688
|
+
};
|
|
1689
|
+
s(M, "type", "spawnShape"), s(M, "editorConfig", null), /**
|
|
1690
|
+
* Dictionary of all registered shape classes.
|
|
1691
|
+
*/
|
|
1692
|
+
s(M, "shapes", {});
|
|
1693
|
+
let S = M;
|
|
1694
|
+
S.registerShape(O);
|
|
1695
|
+
S.registerShape(A);
|
|
1696
|
+
S.registerShape(T);
|
|
1697
|
+
S.registerShape(T, "circle");
|
|
1698
|
+
class tt {
|
|
1699
|
+
constructor(t) {
|
|
1700
|
+
s(this, "order", p.Normal);
|
|
1701
|
+
s(this, "texture");
|
|
1702
|
+
this.texture = typeof t.texture == "string" ? F(t.texture) : t.texture;
|
|
1703
|
+
}
|
|
1704
|
+
initParticles(t) {
|
|
1705
|
+
let e = t;
|
|
1706
|
+
for (; e; )
|
|
1707
|
+
e.texture = this.texture, e = e.next;
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
s(tt, "type", "textureSingle"), s(tt, "editorConfig", null);
|
|
1711
|
+
class et {
|
|
1712
|
+
constructor(t) {
|
|
1713
|
+
s(this, "order", p.Late);
|
|
1714
|
+
s(this, "list");
|
|
1715
|
+
s(this, "minMult");
|
|
1716
|
+
this.list = new R(!1), this.list.reset(P.createList(t.speed)), this.minMult = t.minMult ?? 1;
|
|
1717
|
+
}
|
|
1718
|
+
initParticles(t) {
|
|
1719
|
+
let e = t;
|
|
1720
|
+
for (; e; ) {
|
|
1721
|
+
const a = Math.random() * (1 - this.minMult) + this.minMult;
|
|
1722
|
+
e.config.speedMult = a, e.config.velocity ? e.config.velocity.set(this.list.first.value * a, 0) : e.config.velocity = new C(this.list.first.value * a, 0), w(e.rotation, e.config.velocity), e = e.next;
|
|
1731
1723
|
}
|
|
1732
|
-
});
|
|
1733
|
-
if (i.spawnType === "burst")
|
|
1734
|
-
e.behaviors.push({
|
|
1735
|
-
type: "spawnBurst",
|
|
1736
|
-
config: {
|
|
1737
|
-
start: i.angleStart || 0,
|
|
1738
|
-
spacing: i.particleSpacing,
|
|
1739
|
-
// older formats bursted from a single point
|
|
1740
|
-
distance: 0
|
|
1741
|
-
}
|
|
1742
|
-
});
|
|
1743
|
-
else if (i.spawnType === "point")
|
|
1744
|
-
e.behaviors.push({
|
|
1745
|
-
type: "spawnPoint",
|
|
1746
|
-
config: {}
|
|
1747
|
-
});
|
|
1748
|
-
else {
|
|
1749
|
-
let h;
|
|
1750
|
-
i.spawnType === "ring" ? h = {
|
|
1751
|
-
type: "torus",
|
|
1752
|
-
data: {
|
|
1753
|
-
x: i.spawnCircle.x,
|
|
1754
|
-
y: i.spawnCircle.y,
|
|
1755
|
-
radius: i.spawnCircle.r,
|
|
1756
|
-
innerRadius: i.spawnCircle.minR,
|
|
1757
|
-
affectRotation: !0
|
|
1758
|
-
}
|
|
1759
|
-
} : i.spawnType === "circle" ? h = {
|
|
1760
|
-
type: "torus",
|
|
1761
|
-
data: {
|
|
1762
|
-
x: i.spawnCircle.x,
|
|
1763
|
-
y: i.spawnCircle.y,
|
|
1764
|
-
radius: i.spawnCircle.r,
|
|
1765
|
-
innerRadius: 0,
|
|
1766
|
-
affectRotation: !1
|
|
1767
|
-
}
|
|
1768
|
-
} : i.spawnType === "rect" ? h = {
|
|
1769
|
-
type: "rect",
|
|
1770
|
-
data: i.spawnRect
|
|
1771
|
-
} : i.spawnType === "polygonalChain" && (h = {
|
|
1772
|
-
type: "polygonalChain",
|
|
1773
|
-
data: i.spawnPolygon
|
|
1774
|
-
}), h && e.behaviors.push({
|
|
1775
|
-
type: "spawnShape",
|
|
1776
|
-
config: h
|
|
1777
|
-
});
|
|
1778
1724
|
}
|
|
1779
|
-
|
|
1725
|
+
updateParticle(t, e) {
|
|
1726
|
+
const a = this.list.interpolate(t.agePercent) * t.config.speedMult, r = t.config.velocity;
|
|
1727
|
+
lt(r), rt(r, a), t.x += r.x * e, t.y += r.y * e;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
s(et, "type", "moveSpeed"), s(et, "editorConfig", null);
|
|
1731
|
+
class it {
|
|
1732
|
+
constructor(t) {
|
|
1733
|
+
s(this, "order", p.Late);
|
|
1734
|
+
s(this, "min");
|
|
1735
|
+
s(this, "max");
|
|
1736
|
+
this.min = t.min, this.max = t.max;
|
|
1737
|
+
}
|
|
1738
|
+
initParticles(t) {
|
|
1739
|
+
let e = t;
|
|
1740
|
+
for (; e; ) {
|
|
1741
|
+
const a = Math.random() * (this.max - this.min) + this.min;
|
|
1742
|
+
e.config.velocity ? e.config.velocity.set(a, 0) : e.config.velocity = new C(a, 0), w(e.rotation, e.config.velocity), e = e.next;
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
updateParticle(t, e) {
|
|
1746
|
+
const { velocity: a } = t.config;
|
|
1747
|
+
t.x += a.x * e, t.y += a.y * e;
|
|
1748
|
+
}
|
|
1780
1749
|
}
|
|
1750
|
+
s(it, "type", "moveSpeedStatic"), s(it, "editorConfig", null);
|
|
1751
|
+
const qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1752
|
+
__proto__: null,
|
|
1753
|
+
AccelerationBehavior: I,
|
|
1754
|
+
AlphaBehavior: V,
|
|
1755
|
+
BehaviorOrder: p,
|
|
1756
|
+
BlendModeBehavior: W,
|
|
1757
|
+
BurstSpawnBehavior: Y,
|
|
1758
|
+
ColorBehavior: D,
|
|
1759
|
+
NoRotationBehavior: J,
|
|
1760
|
+
OrderedTextureBehavior: j,
|
|
1761
|
+
PathBehavior: G,
|
|
1762
|
+
PointSpawnBehavior: z,
|
|
1763
|
+
RandomAnimatedTextureBehavior: N,
|
|
1764
|
+
RandomTextureBehavior: $,
|
|
1765
|
+
RotationBehavior: Q,
|
|
1766
|
+
ScaleBehavior: K,
|
|
1767
|
+
ShapeSpawnBehavior: S,
|
|
1768
|
+
SingleAnimatedTextureBehavior: U,
|
|
1769
|
+
SingleTextureBehavior: tt,
|
|
1770
|
+
SpeedBehavior: et,
|
|
1771
|
+
StaticAlphaBehavior: q,
|
|
1772
|
+
StaticColorBehavior: X,
|
|
1773
|
+
StaticRotationBehavior: H,
|
|
1774
|
+
StaticScaleBehavior: Z,
|
|
1775
|
+
StaticSpeedBehavior: it,
|
|
1776
|
+
editor: bt,
|
|
1777
|
+
spawnShapes: St
|
|
1778
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1781
1779
|
m.registerBehavior(I);
|
|
1782
1780
|
m.registerBehavior(V);
|
|
1783
1781
|
m.registerBehavior(q);
|
|
@@ -1801,12 +1799,12 @@ m.registerBehavior(tt);
|
|
|
1801
1799
|
m.registerBehavior(et);
|
|
1802
1800
|
m.registerBehavior(it);
|
|
1803
1801
|
export {
|
|
1804
|
-
|
|
1802
|
+
_t as ContainerParticle,
|
|
1805
1803
|
m as Emitter,
|
|
1806
|
-
|
|
1804
|
+
wt as Particle,
|
|
1807
1805
|
It as ParticleUtils,
|
|
1808
1806
|
R as PropertyList,
|
|
1809
1807
|
P as PropertyNode,
|
|
1810
|
-
|
|
1811
|
-
|
|
1808
|
+
qt as behaviors,
|
|
1809
|
+
Vt as upgradeConfig
|
|
1812
1810
|
};
|