custom-pixi-particles 4.27.1 → 4.29.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/README.md CHANGED
@@ -17,6 +17,7 @@ If you find **CustomPIXIParticles** useful and would like to support my work, yo
17
17
  - **Performance Optimized**: Handle thousands of particles with minimal performance overhead.
18
18
  - **PIXI.js Compatibility**: Fully compatible with **PIXI.js v8**, **PIXI.js v7**, with legacy support for v5.x and v6.x.
19
19
  - **Real-Time Customization**: Dynamically update textures, positions, configurations, and emitters on the fly.
20
+ - **Shatter Effect**: Create dramatic sprite shattering effects with realistic physics and automatic cleanup.
20
21
 
21
22
  ---
22
23
 
@@ -139,6 +140,66 @@ Clears internal object pools to free memory.
139
140
  particles.clearPool()
140
141
  ```
141
142
 
143
+ ### Shatter Effect
144
+ Create a dramatic shattering effect that slices a sprite into fragments with realistic physics.
145
+
146
+ ```javascript
147
+ import { ShatterEffect } from 'custom-pixi-particles'
148
+ import { Sprite, Texture } from 'pixi.js'
149
+
150
+ // Create a sprite to shatter
151
+ const sprite = new Sprite(Texture.from('my-image.png'))
152
+ sprite.anchor.set(0.5, 0.5)
153
+ sprite.x = 400
154
+ sprite.y = 300
155
+
156
+ // Create shatter effect with custom options
157
+ const shatterEffect = new ShatterEffect(sprite, {
158
+ gridCols: 10, // Number of horizontal grid divisions (default: 8)
159
+ gridRows: 10, // Number of vertical grid divisions (default: 8)
160
+ mode: 'radial', // 'radial', 'directional', or 'swirl'.
161
+ explosionPower: 1000, // Velocity of the fragments (default: 1000)
162
+ enableRotation: true, // Whether fragments spin (default: true)
163
+ rotationStrength: 1.0, // Multiplier for fragment spin speed (default: 1.0)
164
+ gravity: 600, // Gravity force applied to fragments (default: 500)
165
+ friction: 0.96, // Velocity air resistance (default: 0.96)
166
+ turbulence: 0.2, // Randomness of fragment angles (default: 0.2)
167
+ lifetime: 2.5, // Lifetime of fragments in seconds (default: 2)
168
+ fadeOutDuration: 0.3, // Fade out duration at the end of lifetime (default: 0.3)
169
+ endTint: 0xFFFFFF // Color to lerp toward as fragments die (default: 0xFFFFFF)
170
+ })
171
+
172
+ // Add to stage
173
+ app.stage.addChild(shatterEffect)
174
+
175
+ // Trigger explosion with optional completion callback
176
+ shatterEffect.Explode().then(() => {
177
+ console.log("Boom! Animation complete.");
178
+ effect.destroy();
179
+ });
180
+
181
+ // Or Simple Usage (Static Method)
182
+ await ShatterEffect.shatter(mySprite, {
183
+ gridCols: 10,
184
+ gridRows: 10,
185
+ explosionPower: 1200,
186
+ enableRotation: true,
187
+ rotationStrength: 1.5
188
+ });
189
+ ```
190
+
191
+ **ShatterEffect Methods:**
192
+ - `Explode(onComplete?)` - Triggers the shatter animation. Optionally accepts a callback when animation completes.
193
+ - `reset()` - Resets the effect to its initial state, allowing it to be triggered again.
194
+ - `destroy()` - Destroys the effect and cleans up all resources.
195
+
196
+ **Features:**
197
+ - Automatically slices sprites into a grid of fragments
198
+ - Each fragment radiates outward from the sprite's center with random variance
199
+ - Realistic physics with gravity and rotation
200
+ - Automatic cleanup and memory management using object pooling
201
+ - Smooth fade-out animation at the end of fragment lifetime
202
+
142
203
  ---
143
204
 
144
205
  ## 🖥️ Versions Compatibility
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import Renderer from './lib/pixi/Renderer';
2
2
  import { ICustomPixiParticlesSettings } from './lib/customPixiParticlesSettingsInterface';
3
3
  import TestRenderer from './lib/pixi/TestRenderer';
4
+ import { ShatterEffect } from './lib/effects';
5
+ export type { IShatterEffectOptions, ShatterMode } from './lib/effects';
4
6
  /**
5
7
  * Constructs a renderer for custom pixi particles
6
8
  * @class Renderer
@@ -12,4 +14,4 @@ declare const customPixiParticles: {
12
14
  declare const _customPixiParticlesEditorOnly: {
13
15
  create(settings: ICustomPixiParticlesSettings): TestRenderer;
14
16
  };
15
- export { Renderer, customPixiParticles, _customPixiParticlesEditorOnly, ICustomPixiParticlesSettings };
17
+ export { Renderer, customPixiParticles, _customPixiParticlesEditorOnly, ICustomPixiParticlesSettings, ShatterEffect };
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import Renderer from './lib/pixi/Renderer';
2
2
  import TestRenderer from './lib/pixi/TestRenderer';
3
+ import { ShatterEffect } from './lib/effects';
3
4
  /**
4
5
  * Constructs a renderer for custom pixi particles
5
6
  * @class Renderer
@@ -41,5 +42,5 @@ const _customPixiParticlesEditorOnly = {
41
42
  });
42
43
  },
43
44
  };
44
- export { Renderer, customPixiParticles, _customPixiParticlesEditorOnly };
45
+ export { Renderer, customPixiParticles, _customPixiParticlesEditorOnly, ShatterEffect };
45
46
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,qBAAqB,CAAA;AAE1C,OAAO,YAAY,MAAM,yBAAyB,CAAA;AAElD;;;;GAIG;AACH,MAAM,mBAAmB,GAAG;IAC1B,MAAM,CAAC,QAAsC;QAC3C,MAAM,EACJ,QAAQ,EACR,aAAa,EACb,qBAAqB,GAAG,CAAC,EACzB,0BAA0B,GAAG,CAAC,EAC9B,iBAAiB,GAAG,EAAE,EACtB,QAAQ,GAAG,IAAI,EACf,QAAQ,GAAG,IAAI,EACf,QAAQ,GAAG,IAAI,EACf,GAAG,GAAG,IAAI,EACV,IAAI,GAAG,IAAI,EACX,YAAY,GAAG,KAAK,EACpB,MAAM,GAAG,EAAE,EACX,MAAM,GAAG,EAAE,EACX,WAAW,GAAG,IAAI,GACnB,GAAG,QAAQ,CAAA;QACZ,OAAO,IAAI,QAAQ,CAAC;YAClB,QAAQ;YACR,qBAAqB;YACrB,0BAA0B;YAC1B,aAAa;YACb,iBAAiB;YACjB,QAAQ;YACR,QAAQ;YACR,QAAQ;YACR,GAAG;YACH,IAAI;YACJ,YAAY;YACZ,MAAM;YACN,MAAM;YACN,WAAW;SACZ,CAAC,CAAA;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iB;YACjB,QAAQ;YACR,QAAQ;YACR,QAAQ;YACR,GAAG;YACH,IAAI;YACJ,YAAY;YACZ,MAAM;YACN,MAAM;YACN,WAAW;SACZ,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,MAAM,8BAA8B,GAAG;IACrC,MAAM,CAAC,QAAsC;QAC3C,MAAM,EACJ,QAAQ,EACR,aAAa,EACb,qBAAqB,GAAG,CAAC,EACzB,0BAA0B,GAAG,CAAC,EAC9B,iBAAiB,GAAG,EAAE,EACtB,MAAM,GAAG,EAAE,EACX,MAAM,GAAG,EAAE,EACX,WAAW,GAAG,IAAI,GACnB,GAAG,QAAQ,CAAA;QACZ,OAAO,IAAI,YAAY,CAAC;YACtB,QAAQ;YACR,qBAAqB;YACrB,0BAA0B;YAC1B,aAAa;YACb,iBAAiB;YACjB,MAAM;YACN,MAAM;YACN,WAAW;SACZ,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,8BAA8B,EAAgC,aAAa,EAAE,CAAA"}
@@ -0,0 +1,45 @@
1
+ import { Container, Sprite } from 'pixi.js-legacy';
2
+ export type ShatterMode = 'radial' | 'directional' | 'swirl';
3
+ export interface IShatterEffectOptions {
4
+ gridCols?: number;
5
+ gridRows?: number;
6
+ explosionPower?: number;
7
+ friction?: number;
8
+ gravity?: number;
9
+ turbulence?: number;
10
+ lifetime?: number;
11
+ fadeOutDuration?: number;
12
+ mode?: ShatterMode;
13
+ explosionOrigin?: {
14
+ x: number;
15
+ y: number;
16
+ };
17
+ blastDirection?: number;
18
+ swirlStrength?: number;
19
+ randomizeScale?: boolean;
20
+ endTint?: number;
21
+ enableRotation?: boolean;
22
+ rotationStrength?: number;
23
+ }
24
+ export default class ShatterEffect extends Container {
25
+ private sourceSprite;
26
+ private fragments;
27
+ private isExploded;
28
+ private options;
29
+ private isCleanedUp;
30
+ private explodeResolve?;
31
+ constructor(sourceSprite: Sprite, options?: IShatterEffectOptions);
32
+ /**
33
+ * Internal method to slice the sprite and setup particles.
34
+ * Called automatically by Explode().
35
+ */
36
+ private createFragments;
37
+ Explode(): Promise<void>;
38
+ private update;
39
+ private finish;
40
+ private lerpColor;
41
+ private removeFragment;
42
+ private cleanup;
43
+ destroy(options?: any): void;
44
+ static shatter(sprite: Sprite, options?: IShatterEffectOptions): Promise<void>;
45
+ }
@@ -0,0 +1,236 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Container, Sprite, Texture, Ticker, Rectangle } from 'pixi.js-legacy';
11
+ import ParticlePool from '../ParticlePool';
12
+ import Random from '../util/Random';
13
+ export default class ShatterEffect extends Container {
14
+ constructor(sourceSprite, options = {}) {
15
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
16
+ super();
17
+ this.fragments = [];
18
+ this.isExploded = false;
19
+ this.isCleanedUp = false;
20
+ this.sourceSprite = sourceSprite;
21
+ this.options = {
22
+ gridCols: (_a = options.gridCols) !== null && _a !== void 0 ? _a : 10,
23
+ gridRows: (_b = options.gridRows) !== null && _b !== void 0 ? _b : 10,
24
+ explosionPower: (_c = options.explosionPower) !== null && _c !== void 0 ? _c : 1000,
25
+ friction: (_d = options.friction) !== null && _d !== void 0 ? _d : 0.96,
26
+ gravity: (_e = options.gravity) !== null && _e !== void 0 ? _e : 800,
27
+ turbulence: (_f = options.turbulence) !== null && _f !== void 0 ? _f : 0.2,
28
+ lifetime: (_g = options.lifetime) !== null && _g !== void 0 ? _g : 2.0,
29
+ fadeOutDuration: (_h = options.fadeOutDuration) !== null && _h !== void 0 ? _h : 0.5,
30
+ mode: (_j = options.mode) !== null && _j !== void 0 ? _j : 'radial',
31
+ explosionOrigin: (_k = options.explosionOrigin) !== null && _k !== void 0 ? _k : { x: 0.5, y: 0.5 },
32
+ blastDirection: (_l = options.blastDirection) !== null && _l !== void 0 ? _l : 0,
33
+ swirlStrength: (_m = options.swirlStrength) !== null && _m !== void 0 ? _m : 0,
34
+ randomizeScale: (_o = options.randomizeScale) !== null && _o !== void 0 ? _o : false,
35
+ endTint: (_p = options.endTint) !== null && _p !== void 0 ? _p : 0xFFFFFF,
36
+ enableRotation: (_q = options.enableRotation) !== null && _q !== void 0 ? _q : true,
37
+ rotationStrength: (_r = options.rotationStrength) !== null && _r !== void 0 ? _r : 1.0
38
+ };
39
+ this.x = this.sourceSprite.x;
40
+ this.y = this.sourceSprite.y;
41
+ this.rotation = this.sourceSprite.rotation;
42
+ // Hide original sprite immediately
43
+ this.sourceSprite.visible = false;
44
+ }
45
+ /**
46
+ * Internal method to slice the sprite and setup particles.
47
+ * Called automatically by Explode().
48
+ */
49
+ createFragments() {
50
+ const texture = this.sourceSprite.texture;
51
+ if (!texture || !texture.valid)
52
+ return;
53
+ const scale = this.sourceSprite.scale.x;
54
+ const texFrame = texture.frame;
55
+ const stepW = texFrame.width / this.options.gridCols;
56
+ const stepH = texFrame.height / this.options.gridRows;
57
+ const anchorX = this.sourceSprite.anchor.x;
58
+ const anchorY = this.sourceSprite.anchor.y;
59
+ const originX = texFrame.width * this.options.explosionOrigin.x;
60
+ const originY = texFrame.height * this.options.explosionOrigin.y;
61
+ for (let row = 0; row < this.options.gridRows; row++) {
62
+ for (let col = 0; col < this.options.gridCols; col++) {
63
+ const x1 = Math.floor(col * stepW);
64
+ const y1 = Math.floor(row * stepH);
65
+ const x2 = Math.min(Math.floor((col + 1) * stepW), texFrame.width);
66
+ const y2 = Math.min(Math.floor((row + 1) * stepH), texFrame.height);
67
+ const currentFragW = x2 - x1;
68
+ const currentFragH = y2 - y1;
69
+ if (currentFragW <= 0 || currentFragH <= 0)
70
+ continue;
71
+ const fragRect = new Rectangle(texFrame.x + x1, texFrame.y + y1, currentFragW, currentFragH);
72
+ const fragTex = new Texture(texture.baseTexture, fragRect);
73
+ const sprite = new Sprite(fragTex);
74
+ sprite.anchor.set(0.5);
75
+ const finalScale = this.options.randomizeScale ? scale * Random.uniform(0.8, 1.2) : scale;
76
+ sprite.scale.set(finalScale);
77
+ const lx = (x1 - (texFrame.width * anchorX) + currentFragW / 2) * scale;
78
+ const ly = (y1 - (texFrame.height * anchorY) + currentFragH / 2) * scale;
79
+ const dx = (x1 + currentFragW / 2) - originX;
80
+ const dy = (y1 + currentFragH / 2) - originY;
81
+ const dist = Math.sqrt(dx * dx + dy * dy);
82
+ const angleToOrigin = Math.atan2(dy, dx);
83
+ let vx = 0;
84
+ let vy = 0;
85
+ if (this.options.mode === 'radial' || this.options.mode === 'swirl') {
86
+ const force = (1.5 - (dist / texFrame.width)) * this.options.explosionPower;
87
+ const angle = angleToOrigin + Random.uniform(-this.options.turbulence, this.options.turbulence);
88
+ vx = Math.cos(angle) * force;
89
+ vy = Math.sin(angle) * force;
90
+ if (this.options.mode === 'swirl') {
91
+ const swirl = this.options.swirlStrength;
92
+ vx += Math.cos(angle + Math.PI / 2) * (dist * swirl);
93
+ vy += Math.sin(angle + Math.PI / 2) * (dist * swirl);
94
+ }
95
+ }
96
+ else if (this.options.mode === 'directional') {
97
+ const force = this.options.explosionPower * Random.uniform(0.5, 1.5);
98
+ const angle = this.options.blastDirection + Random.uniform(-this.options.turbulence, this.options.turbulence);
99
+ vx = Math.cos(angle) * force;
100
+ vy = Math.sin(angle) * force;
101
+ }
102
+ const particle = ParticlePool.global.pop();
103
+ particle.reset();
104
+ particle.x = lx;
105
+ particle.y = ly;
106
+ particle.velocity.set(vx, vy);
107
+ particle.acceleration.set(0, this.options.gravity);
108
+ particle.maxLifeTime = this.options.lifetime * Random.uniform(0.8, 1.2);
109
+ particle.lifeTime = 0;
110
+ if (this.options.enableRotation) {
111
+ particle.radiansPerSecond = Random.uniform(-12, 12) * this.options.rotationStrength;
112
+ }
113
+ else {
114
+ particle.radiansPerSecond = 0;
115
+ }
116
+ this.fragments.push({
117
+ sprite,
118
+ particle,
119
+ initialScale: finalScale,
120
+ vz: Random.uniform(-15, 15),
121
+ z: 0
122
+ });
123
+ this.addChild(sprite);
124
+ }
125
+ }
126
+ }
127
+ Explode() {
128
+ if (this.isExploded)
129
+ return Promise.resolve();
130
+ this.isExploded = true;
131
+ this.createFragments();
132
+ Ticker.shared.add(this.update, this);
133
+ return new Promise((resolve) => {
134
+ this.explodeResolve = resolve;
135
+ });
136
+ }
137
+ update() {
138
+ if (!this.isExploded || this.isCleanedUp)
139
+ return;
140
+ const dt = Ticker.shared.deltaMS / 1000;
141
+ for (let i = this.fragments.length - 1; i >= 0; i--) {
142
+ const f = this.fragments[i];
143
+ const p = f.particle;
144
+ p.lifeTime += dt;
145
+ p.velocity.x *= this.options.friction;
146
+ p.velocity.y *= this.options.friction;
147
+ p.velocity.y += p.acceleration.y * dt;
148
+ p.x += p.velocity.x * dt;
149
+ p.y += p.velocity.y * dt;
150
+ p.rotation += p.radiansPerSecond * dt;
151
+ f.z += f.vz * dt;
152
+ const depthScale = Math.max(0.1, 1 + (f.z / 200));
153
+ f.sprite.x = p.x;
154
+ f.sprite.y = p.y;
155
+ f.sprite.rotation = p.rotation;
156
+ f.sprite.scale.set(f.initialScale * depthScale);
157
+ const progress = p.lifeTime / p.maxLifeTime;
158
+ if (this.options.endTint !== 0xFFFFFF) {
159
+ f.sprite.tint = this.lerpColor(0xFFFFFF, this.options.endTint, progress);
160
+ }
161
+ const fadeThreshold = 1 - (this.options.fadeOutDuration / p.maxLifeTime);
162
+ if (progress > fadeThreshold) {
163
+ f.sprite.alpha = Math.max(0, (1 - progress) / (1 - fadeThreshold));
164
+ }
165
+ if (p.lifeTime >= p.maxLifeTime || f.sprite.alpha <= 0) {
166
+ this.removeFragment(i);
167
+ }
168
+ }
169
+ if (this.fragments.length === 0) {
170
+ this.finish();
171
+ }
172
+ }
173
+ finish() {
174
+ Ticker.shared.remove(this.update, this);
175
+ if (this.explodeResolve) {
176
+ this.explodeResolve();
177
+ this.explodeResolve = undefined;
178
+ }
179
+ }
180
+ lerpColor(start, end, t) {
181
+ // tslint:disable-next-line:one-variable-per-declaration no-bitwise
182
+ const r1 = (start >> 16) & 0xff, g1 = (start >> 8) & 0xff, b1 = start & 0xff;
183
+ // tslint:disable-next-line:one-variable-per-declaration no-bitwise
184
+ const r2 = (end >> 16) & 0xff, g2 = (end >> 8) & 0xff, b2 = end & 0xff;
185
+ // tslint:disable-next-line:one-variable-per-declaration no-bitwise
186
+ const r = r1 + (r2 - r1) * t, g = g1 + (g2 - g1) * t, b = b1 + (b2 - b1) * t;
187
+ // tslint:disable-next-line:no-bitwise
188
+ return (r << 16) | (g << 8) | b;
189
+ }
190
+ removeFragment(index) {
191
+ const f = this.fragments[index];
192
+ if (f.particle)
193
+ ParticlePool.global.push(f.particle);
194
+ if (f.sprite) {
195
+ this.removeChild(f.sprite);
196
+ f.sprite.destroy();
197
+ }
198
+ this.fragments.splice(index, 1);
199
+ }
200
+ cleanup() {
201
+ if (this.isCleanedUp)
202
+ return;
203
+ this.isCleanedUp = true;
204
+ Ticker.shared.remove(this.update, this);
205
+ this.fragments.forEach(f => {
206
+ if (f.sprite) {
207
+ if (f.sprite.parent)
208
+ f.sprite.parent.removeChild(f.sprite);
209
+ f.sprite.destroy();
210
+ }
211
+ if (f.particle)
212
+ ParticlePool.global.push(f.particle);
213
+ });
214
+ this.fragments = [];
215
+ if (this.explodeResolve) {
216
+ this.explodeResolve();
217
+ this.explodeResolve = undefined;
218
+ }
219
+ }
220
+ destroy(options) {
221
+ this.cleanup();
222
+ super.destroy(options);
223
+ }
224
+ static shatter(sprite_1) {
225
+ return __awaiter(this, arguments, void 0, function* (sprite, options = {}) {
226
+ if (!sprite.parent)
227
+ return;
228
+ const effect = new ShatterEffect(sprite, options);
229
+ const index = sprite.parent.getChildIndex(sprite);
230
+ sprite.parent.addChildAt(effect, index);
231
+ yield effect.Explode();
232
+ effect.destroy();
233
+ });
234
+ }
235
+ }
236
+ //# sourceMappingURL=ShatterEffect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShatterEffect.js","sourceRoot":"","sources":["../../../src/lib/effects/ShatterEffect.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAE1C,OAAO,MAAM,MAAM,gBAAgB,CAAA;AAgCnC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,SAAS;IASlD,YAAY,YAAoB,EAAE,UAAiC,EAAE;;QACnE,KAAK,EAAE,CAAA;QARD,cAAS,GAAe,EAAE,CAAA;QAC1B,eAAU,GAAY,KAAK,CAAA;QAE3B,gBAAW,GAAY,KAAK,CAAA;QAOlC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAChC,IAAI,CAAC,OAAO,GAAG;YACb,QAAQ,EAAE,MAAA,OAAO,CAAC,QAAQ,mCAAI,EAAE;YAChC,QAAQ,EAAE,MAAA,OAAO,CAAC,QAAQ,mCAAI,EAAE;YAChC,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,IAAI;YAC9C,QAAQ,EAAE,MAAA,OAAO,CAAC,QAAQ,mCAAI,IAAI;YAClC,OAAO,EAAE,MAAA,OAAO,CAAC,OAAO,mCAAI,GAAG;YAC/B,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,GAAG;YACrC,QAAQ,EAAE,MAAA,OAAO,CAAC,QAAQ,mCAAI,GAAG;YACjC,eAAe,EAAE,MAAA,OAAO,CAAC,eAAe,mCAAI,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AAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;QACtD,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;QACnB,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,IAAI,CAAC,cAAc,EAAE,CAAA;YACrB,IAAI,CAAC,cAAc,GAAG,SAAS,CAAA;QACjC,CAAC;IACH,CAAC;IAEM,OAAO,CAAC,OAAa;QAC1B,IAAI,CAAC,OAAO,EAAE,CAAA;QACd,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACxB,CAAC;IAEM,MAAM,CAAO,OAAO;6DAAC,MAAc,EAAE,UAAiC,EAAE;YAC7E,IAAI,CAAC,MAAM,CAAC,MAAM;gBAAE,OAAO;YAC3B,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAClD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAClD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAExC,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;YACvB,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC;KAAA;CACF"}
@@ -0,0 +1 @@
1
+ export { default as ShatterEffect, IShatterEffectOptions, ShatterMode } from './ShatterEffect';
@@ -0,0 +1,3 @@
1
+ // src/lib/effects/index.ts
2
+ export { default as ShatterEffect } from './ShatterEffect';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/effects/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,OAAO,EAAE,OAAO,IAAI,aAAa,EAAsC,MAAM,iBAAiB,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import * as controller from './emission';
2
2
  import * as behaviour from './behaviour';
3
3
  import * as parser from './parser';
4
+ import * as effects from './effects';
4
5
  import Particle from './Particle';
5
6
  import ParticlePool from './ParticlePool';
6
7
  import { Duration, Emitter } from './emitter';
@@ -11,6 +12,7 @@ declare const cpp: {
11
12
  parser: typeof parser;
12
13
  controller: typeof controller;
13
14
  behaviour: typeof behaviour;
15
+ effects: typeof effects;
14
16
  Color: typeof Color;
15
17
  Point: typeof Point;
16
18
  Random: typeof Random;
package/dist/lib/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as controller from './emission';
2
2
  import * as behaviour from './behaviour';
3
3
  import * as parser from './parser';
4
+ import * as effects from './effects';
4
5
  import Particle from './Particle';
5
6
  import ParticlePool from './ParticlePool';
6
7
  import { Duration, Emitter } from './emitter';
@@ -11,6 +12,7 @@ const cpp = {
11
12
  parser,
12
13
  controller,
13
14
  behaviour,
15
+ effects,
14
16
  Color,
15
17
  Point,
16
18
  Random,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE7C,MAAM,GAAG,GAAG;IACV,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,UAAU;IACV,SAAS;IACT,KAAK;IACL,KAAK;IACL,MAAM;IACN,QAAQ;IACR,OAAO;CACR,CAAA;AAED,eAAe,GAAG,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AACpC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE7C,MAAM,GAAG,GAAG;IACV,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,UAAU;IACV,SAAS;IACT,OAAO;IACP,KAAK;IACL,KAAK;IACL,MAAM;IACN,QAAQ;IACR,OAAO;CACR,CAAA;AAED,eAAe,GAAG,CAAA"}
package/package.json CHANGED
@@ -42,5 +42,5 @@
42
42
  "lint": "tslint 'src/**/*.ts'",
43
43
  "lint:fix": "tslint --fix 'src/**/*.ts'"
44
44
  },
45
- "version": "4.27.1"
45
+ "version": "4.29.0"
46
46
  }