@rb-games/core 0.1.3 → 0.1.5

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.
Files changed (36) hide show
  1. package/dist/{chunk-DOHQE2YZ.js → chunk-C45KDREE.js} +46 -50
  2. package/dist/chunk-C45KDREE.js.map +1 -0
  3. package/dist/{chunk-RAEOBW6E.js → chunk-P4GCINNA.js} +3 -3
  4. package/dist/{chunk-RAEOBW6E.js.map → chunk-P4GCINNA.js.map} +1 -1
  5. package/dist/{chunk-YSLGJAV6.js → chunk-XHUPUPPW.js} +3 -5
  6. package/dist/chunk-XHUPUPPW.js.map +1 -0
  7. package/dist/engine/index.js +5 -6
  8. package/dist/engine/index.js.map +1 -1
  9. package/dist/helpers/index.js +4 -4
  10. package/dist/helpers/index.js.map +1 -1
  11. package/dist/i18n/index.js +2 -2
  12. package/dist/particle/index.js +109 -476
  13. package/dist/particle/index.js.map +1 -1
  14. package/dist/plugins/index.js +157 -202
  15. package/dist/plugins/index.js.map +1 -1
  16. package/dist/plugins/language/I18NextPlugin.types.d.ts +2 -1
  17. package/dist/plugins/language/I18NextPlugin.types.d.ts.map +1 -1
  18. package/dist/state-machine/index.js +1583 -11
  19. package/dist/state-machine/index.js.map +1 -1
  20. package/dist/store/index.js +3 -4
  21. package/dist/store/index.js.map +1 -1
  22. package/dist/ui/components/Skinable.d.ts.map +1 -1
  23. package/dist/ui/index.js +142 -191
  24. package/dist/ui/index.js.map +1 -1
  25. package/dist/utils/index.js +2 -2
  26. package/package.json +2 -11
  27. package/dist/chunk-DOHQE2YZ.js.map +0 -1
  28. package/dist/chunk-JHN6RF66.js +0 -1580
  29. package/dist/chunk-JHN6RF66.js.map +0 -1
  30. package/dist/chunk-YSLGJAV6.js.map +0 -1
  31. package/dist/vite/index.d.ts +0 -3
  32. package/dist/vite/index.d.ts.map +0 -1
  33. package/dist/vite/index.js +0 -128
  34. package/dist/vite/index.js.map +0 -1
  35. package/dist/vite/mergeLocalesPlugin.d.ts +0 -22
  36. package/dist/vite/mergeLocalesPlugin.d.ts.map +0 -1
@@ -21,23 +21,6 @@ __export(ParticleUtils_exports, {
21
21
 
22
22
  // particle/PropertyNode.ts
23
23
  var PropertyNode = class _PropertyNode {
24
- /**
25
- * Value for the node.
26
- */
27
- value;
28
- /**
29
- * Time value for the node. Between 0-1.
30
- */
31
- time;
32
- /**
33
- * The next node in line.
34
- */
35
- next;
36
- /**
37
- * If this is the first node in the list, controls if the entire list is stepped or not.
38
- */
39
- isStepped;
40
- ease;
41
24
  /**
42
25
  * @param value The value for this node
43
26
  * @param time The time for this node, between 0-1
@@ -186,40 +169,6 @@ function createSteppedGradient(list, numSteps = 10) {
186
169
  return first;
187
170
  }
188
171
  var Particle = class extends Sprite {
189
- /**
190
- * The emitter that controls this particle.
191
- */
192
- emitter;
193
- /**
194
- * The maximum lifetime of this particle, in seconds.
195
- */
196
- maxLife;
197
- /**
198
- * The current age of the particle, in seconds.
199
- */
200
- age;
201
- /**
202
- * The current age of the particle as a normalized value between 0 and 1.
203
- */
204
- agePercent;
205
- /**
206
- * One divided by the max life of the particle, saved for slightly faster math.
207
- */
208
- oneOverLife;
209
- /**
210
- * Reference to the next particle in the list.
211
- */
212
- next;
213
- /**
214
- * Reference to the previous particle in the list.
215
- */
216
- prev;
217
- prevChild;
218
- nextChild;
219
- /**
220
- * Static per-particle configuration for behaviors to use. Is not cleared when recycling.
221
- */
222
- config;
223
172
  /**
224
173
  * @param emitter The emitter that controls this particle.
225
174
  */
@@ -281,8 +230,7 @@ var BehaviorOrder = /* @__PURE__ */ ((BehaviorOrder2) => {
281
230
  })(BehaviorOrder || {});
282
231
  var ticker = Ticker.shared;
283
232
  var PositionParticle = Symbol("Position particle per emitter position");
284
- var Emitter = class _Emitter {
285
- static knownBehaviors = {};
233
+ var _Emitter = class _Emitter {
286
234
  /**
287
235
  * Registers a new behavior, so that it will be recognized when initializing emitters.
288
236
  * Behaviors registered later with duplicate types will override older ones, although there is no limit on
@@ -292,149 +240,6 @@ var Emitter = class _Emitter {
292
240
  static registerBehavior(constructor) {
293
241
  _Emitter.knownBehaviors[constructor.type] = constructor;
294
242
  }
295
- /**
296
- * Active initialization behaviors for this emitter.
297
- */
298
- initBehaviors;
299
- /**
300
- * Active update behaviors for this emitter.
301
- */
302
- updateBehaviors;
303
- /**
304
- * Active recycle behaviors for this emitter.
305
- */
306
- recycleBehaviors;
307
- // properties for individual particles
308
- /**
309
- * The minimum lifetime for a particle, in seconds.
310
- */
311
- minLifetime;
312
- /**
313
- * The maximum lifetime for a particle, in seconds.
314
- */
315
- maxLifetime;
316
- /**
317
- * An easing function for nonlinear interpolation of values. Accepts a single
318
- * parameter of time as a value from 0-1, inclusive. Expected outputs are values
319
- * from 0-1, inclusive.
320
- */
321
- customEase;
322
- // properties for spawning particles
323
- /**
324
- * Time between particle spawns in seconds.
325
- */
326
- _frequency;
327
- /**
328
- * Chance that a particle will be spawned on each opportunity to spawn one.
329
- * 0 is 0%, 1 is 100%.
330
- */
331
- spawnChance;
332
- /**
333
- * Maximum number of particles to keep alive at a time. If this limit
334
- * is reached, no more particles will spawn until some have died.
335
- */
336
- maxParticles;
337
- /**
338
- * The amount of time in seconds to emit for before setting emit to false.
339
- * A value of -1 is an unlimited amount of time.
340
- */
341
- emitterLifetime;
342
- /**
343
- * Position at which to spawn particles, relative to the emitter's owner's origin.
344
- * For example, the flames of a rocket travelling right might have a spawnPos
345
- * of {x:-50, y:0}.
346
- * to spawn at the rear of the rocket.
347
- * To change this, use updateSpawnPos().
348
- */
349
- spawnPos;
350
- /**
351
- * Number of particles to spawn time that the frequency allows for particles to spawn.
352
- */
353
- particlesPerWave;
354
- /**
355
- * Rotation of the emitter or emitter's owner in degrees. This is added to
356
- * the calculated spawn angle.
357
- * To change this, use rotate().
358
- */
359
- rotation;
360
- /**
361
- * The world position of the emitter's owner, to add spawnPos to when
362
- * spawning particles. To change this, use updateOwnerPos().
363
- */
364
- ownerPos;
365
- /**
366
- * The origin + spawnPos in the previous update, so that the spawn position
367
- * can be interpolated to space out particles better.
368
- */
369
- _prevEmitterPos;
370
- /**
371
- * If _prevEmitterPos is valid, to prevent interpolation on the first update
372
- */
373
- _prevPosIsValid;
374
- /**
375
- * If either ownerPos or spawnPos has changed since the previous update.
376
- */
377
- _posChanged;
378
- /**
379
- * The container to add particles to.
380
- */
381
- _parent;
382
- /**
383
- * If particles should be added at the back of the display list instead of the front.
384
- */
385
- addAtBack;
386
- /**
387
- * The current number of active particles.
388
- */
389
- particleCount;
390
- /**
391
- * If particles should be emitted during update() calls. Setting this to false
392
- * stops new particles from being created, but allows existing ones to die out.
393
- */
394
- _emit;
395
- /**
396
- * The timer for when to spawn particles in seconds, where numbers less
397
- * than 0 mean that particles should be spawned.
398
- */
399
- _spawnTimer;
400
- /**
401
- * The life of the emitter in seconds.
402
- */
403
- _emitterLife;
404
- /**
405
- * The particles that are active and on the display list. This is the first particle in a
406
- * linked list.
407
- */
408
- _activeParticlesFirst;
409
- /**
410
- * The particles that are active and on the display list. This is the last particle in a
411
- * linked list.
412
- */
413
- _activeParticlesLast;
414
- /**
415
- * The particles that are not currently being used. This is the first particle in a
416
- * linked list.
417
- */
418
- _poolFirst;
419
- /**
420
- * The original config object that this emitter was initialized with.
421
- */
422
- _origConfig;
423
- /**
424
- * If the update function is called automatically from the shared ticker.
425
- * Setting this to false requires calling the update function manually.
426
- */
427
- _autoUpdate;
428
- /**
429
- * If the emitter should destroy itself when all particles have died out. This is set by
430
- * playOnceAndDestroy();
431
- */
432
- _destroyWhenComplete;
433
- /**
434
- * A callback for when all particles have died out. This is set by
435
- * playOnceAndDestroy() or playOnce();
436
- */
437
- _completeCallback;
438
243
  /**
439
244
  * Factory method to create a new particle. Override this in subclasses
440
245
  * to create custom particle types (e.g., SpineParticle).
@@ -991,6 +796,8 @@ var Emitter = class _Emitter {
991
796
  this.initBehaviors.length = this.updateBehaviors.length = this.recycleBehaviors.length = 0;
992
797
  }
993
798
  };
799
+ _Emitter.knownBehaviors = {};
800
+ var Emitter = _Emitter;
994
801
 
995
802
  // particle/behaviors/index.ts
996
803
  var behaviors_exports = {};
@@ -1038,24 +845,6 @@ __export(shapes_exports, {
1038
845
 
1039
846
  // particle/behaviors/shapes/Rectangle.ts
1040
847
  var Rectangle = class {
1041
- static type = "rect";
1042
- static editorConfig = null;
1043
- /**
1044
- * X (left) position of the rectangle.
1045
- */
1046
- x;
1047
- /**
1048
- * Y (top) position of the rectangle.
1049
- */
1050
- y;
1051
- /**
1052
- * Width of the rectangle.
1053
- */
1054
- w;
1055
- /**
1056
- * Height of the rectangle.
1057
- */
1058
- h;
1059
848
  constructor(config) {
1060
849
  this.x = config.x;
1061
850
  this.y = config.y;
@@ -1067,31 +856,11 @@ var Rectangle = class {
1067
856
  particle.y = Math.random() * this.h + this.y;
1068
857
  }
1069
858
  };
859
+ Rectangle.type = "rect";
860
+ Rectangle.editorConfig = null;
1070
861
 
1071
862
  // particle/behaviors/shapes/Torus.ts
1072
863
  var Torus = class {
1073
- static type = "torus";
1074
- static editorConfig = null;
1075
- /**
1076
- * X position of the center of the shape.
1077
- */
1078
- x;
1079
- /**
1080
- * Y position of the center of the shape.
1081
- */
1082
- y;
1083
- /**
1084
- * Radius of circle, or outer radius of a ring.
1085
- */
1086
- radius;
1087
- /**
1088
- * Inner radius of a ring. Use 0 to have a circle.
1089
- */
1090
- innerRadius;
1091
- /**
1092
- * If rotation should be applied to particles.
1093
- */
1094
- rotation;
1095
864
  constructor(config) {
1096
865
  this.x = config.x || 0;
1097
866
  this.y = config.y || 0;
@@ -1115,24 +884,11 @@ var Torus = class {
1115
884
  particle.position.y += this.y;
1116
885
  }
1117
886
  };
887
+ Torus.type = "torus";
888
+ Torus.editorConfig = null;
1118
889
 
1119
890
  // particle/behaviors/shapes/PolygonalChain.ts
1120
891
  var PolygonalChain = class {
1121
- static type = "polygonalChain";
1122
- static editorConfig = null;
1123
- /**
1124
- * List of segment objects in the chain.
1125
- */
1126
- segments;
1127
- /**
1128
- * Total length of all segments of the chain.
1129
- */
1130
- totalLength;
1131
- /**
1132
- * Total length of segments up to and including the segment of the same index.
1133
- * Used for weighted random selection of segment.
1134
- */
1135
- countingLengths;
1136
892
  /**
1137
893
  * @param data Point data for polygon chains. Either a list of points for a single chain, or a list of chains.
1138
894
  */
@@ -1200,21 +956,16 @@ var PolygonalChain = class {
1200
956
  out.y = p1.y + lerp * (p2.y - p1.y);
1201
957
  }
1202
958
  };
959
+ PolygonalChain.type = "polygonalChain";
960
+ PolygonalChain.editorConfig = null;
1203
961
 
1204
962
  // particle/behaviors/editor/Types.ts
1205
963
  var Types_exports = {};
1206
964
  var AccelerationBehavior = class {
1207
- static type = "moveAcceleration";
1208
- static editorConfig = null;
1209
- // doesn't _really_ need to be late, but doing so ensures that we can override any
1210
- // rotation behavior that is mistakenly added
1211
- order = 5 /* Late */;
1212
- minStart;
1213
- maxStart;
1214
- accel;
1215
- rotate;
1216
- maxSpeed;
1217
965
  constructor(config) {
966
+ // doesn't _really_ need to be late, but doing so ensures that we can override any
967
+ // rotation behavior that is mistakenly added
968
+ this.order = 5 /* Late */;
1218
969
  this.minStart = config.minStart;
1219
970
  this.maxStart = config.maxStart;
1220
971
  this.accel = config.accel;
@@ -1253,6 +1004,8 @@ var AccelerationBehavior = class {
1253
1004
  }
1254
1005
  }
1255
1006
  };
1007
+ AccelerationBehavior.type = "moveAcceleration";
1008
+ AccelerationBehavior.editorConfig = null;
1256
1009
 
1257
1010
  // particle/PropertyList.ts
1258
1011
  function intValueSimple(lerp) {
@@ -1313,27 +1066,6 @@ function intColorStepped(lerp) {
1313
1066
  return combineRGBComponents(curVal.r, curVal.g, curVal.b);
1314
1067
  }
1315
1068
  var PropertyList = class {
1316
- /**
1317
- * The first property node in the linked list.
1318
- */
1319
- first;
1320
- /**
1321
- * Calculates the correct value for the current interpolation value. This method is set in
1322
- * the reset() method.
1323
- * @param lerp The interpolation value from 0-1.
1324
- * @return The interpolated value. Colors are converted to the hex value.
1325
- */
1326
- interpolate;
1327
- /**
1328
- * A custom easing method for this list.
1329
- * @param lerp The interpolation value from 0-1.
1330
- * @return The eased value, also from 0-1.
1331
- */
1332
- ease;
1333
- /**
1334
- * If this list manages colors, which requires a different method for interpolation.
1335
- */
1336
- isColor;
1337
1069
  /**
1338
1070
  * @param isColor If this list handles color values
1339
1071
  */
@@ -1364,11 +1096,8 @@ var PropertyList = class {
1364
1096
 
1365
1097
  // particle/behaviors/Alpha.ts
1366
1098
  var AlphaBehavior = class {
1367
- static type = "alpha";
1368
- static editorConfig = null;
1369
- order = 2 /* Normal */;
1370
- list;
1371
1099
  constructor(config) {
1100
+ this.order = 2 /* Normal */;
1372
1101
  this.list = new PropertyList(false);
1373
1102
  this.list.reset(PropertyNode.createList(config.alpha));
1374
1103
  }
@@ -1383,12 +1112,11 @@ var AlphaBehavior = class {
1383
1112
  particle.alpha = this.list.interpolate(particle.agePercent);
1384
1113
  }
1385
1114
  };
1115
+ AlphaBehavior.type = "alpha";
1116
+ AlphaBehavior.editorConfig = null;
1386
1117
  var StaticAlphaBehavior = class {
1387
- static type = "alphaStatic";
1388
- static editorConfig = null;
1389
- order = 2 /* Normal */;
1390
- value;
1391
1118
  constructor(config) {
1119
+ this.order = 2 /* Normal */;
1392
1120
  this.value = config.alpha;
1393
1121
  }
1394
1122
  initParticles(first) {
@@ -1399,6 +1127,8 @@ var StaticAlphaBehavior = class {
1399
1127
  }
1400
1128
  }
1401
1129
  };
1130
+ StaticAlphaBehavior.type = "alphaStatic";
1131
+ StaticAlphaBehavior.editorConfig = null;
1402
1132
  function getTextures(textures) {
1403
1133
  const outTextures = [];
1404
1134
  for (let j = 0; j < textures.length; ++j) {
@@ -1422,11 +1152,8 @@ function getTextures(textures) {
1422
1152
  return outTextures;
1423
1153
  }
1424
1154
  var RandomAnimatedTextureBehavior = class {
1425
- static type = "animatedRandom";
1426
- static editorConfig = null;
1427
- order = 2 /* Normal */;
1428
- anims;
1429
1155
  constructor(config) {
1156
+ this.order = 2 /* Normal */;
1430
1157
  this.anims = [];
1431
1158
  for (let i = 0; i < config.anims.length; ++i) {
1432
1159
  const anim = config.anims[i];
@@ -1473,12 +1200,11 @@ var RandomAnimatedTextureBehavior = class {
1473
1200
  particle.texture = anim.textures[frame] || anim.textures[anim.textures.length - 1] || Texture.EMPTY;
1474
1201
  }
1475
1202
  };
1203
+ RandomAnimatedTextureBehavior.type = "animatedRandom";
1204
+ RandomAnimatedTextureBehavior.editorConfig = null;
1476
1205
  var SingleAnimatedTextureBehavior = class {
1477
- static type = "animatedSingle";
1478
- static editorConfig = null;
1479
- order = 2 /* Normal */;
1480
- anim;
1481
1206
  constructor(config) {
1207
+ this.order = 2 /* Normal */;
1482
1208
  const anim = config.anim;
1483
1209
  const textures = getTextures(anim.textures);
1484
1210
  const framerate = anim.framerate < 0 ? -1 : anim.framerate > 0 ? anim.framerate : 60;
@@ -1520,14 +1246,13 @@ var SingleAnimatedTextureBehavior = class {
1520
1246
  particle.texture = anim.textures[frame] || anim.textures[anim.textures.length - 1] || Texture.EMPTY;
1521
1247
  }
1522
1248
  };
1249
+ SingleAnimatedTextureBehavior.type = "animatedSingle";
1250
+ SingleAnimatedTextureBehavior.editorConfig = null;
1523
1251
 
1524
1252
  // particle/behaviors/BlendMode.ts
1525
1253
  var BlendModeBehavior = class {
1526
- static type = "blendMode";
1527
- static editorConfig = null;
1528
- order = 2 /* Normal */;
1529
- value;
1530
1254
  constructor(config) {
1255
+ this.order = 2 /* Normal */;
1531
1256
  this.value = config.blendMode;
1532
1257
  }
1533
1258
  initParticles(first) {
@@ -1538,16 +1263,13 @@ var BlendModeBehavior = class {
1538
1263
  }
1539
1264
  }
1540
1265
  };
1266
+ BlendModeBehavior.type = "blendMode";
1267
+ BlendModeBehavior.editorConfig = null;
1541
1268
 
1542
1269
  // particle/behaviors/BurstSpawn.ts
1543
1270
  var BurstSpawnBehavior = class {
1544
- static type = "spawnBurst";
1545
- static editorConfig = null;
1546
- order = 0 /* Spawn */;
1547
- spacing;
1548
- start;
1549
- distance;
1550
1271
  constructor(config) {
1272
+ this.order = 0 /* Spawn */;
1551
1273
  this.spacing = config.spacing * DEG_TO_RADS;
1552
1274
  this.start = config.start * DEG_TO_RADS;
1553
1275
  this.distance = config.distance;
@@ -1572,14 +1294,13 @@ var BurstSpawnBehavior = class {
1572
1294
  }
1573
1295
  }
1574
1296
  };
1297
+ BurstSpawnBehavior.type = "spawnBurst";
1298
+ BurstSpawnBehavior.editorConfig = null;
1575
1299
 
1576
1300
  // particle/behaviors/Color.ts
1577
1301
  var ColorBehavior = class {
1578
- static type = "color";
1579
- static editorConfig = null;
1580
- order = 2 /* Normal */;
1581
- list;
1582
1302
  constructor(config) {
1303
+ this.order = 2 /* Normal */;
1583
1304
  this.list = new PropertyList(true);
1584
1305
  this.list.reset(PropertyNode.createList(config.color));
1585
1306
  }
@@ -1596,12 +1317,11 @@ var ColorBehavior = class {
1596
1317
  particle.tint = this.list.interpolate(particle.agePercent);
1597
1318
  }
1598
1319
  };
1320
+ ColorBehavior.type = "color";
1321
+ ColorBehavior.editorConfig = null;
1599
1322
  var StaticColorBehavior = class {
1600
- static type = "colorStatic";
1601
- static editorConfig = null;
1602
- order = 2 /* Normal */;
1603
- value;
1604
1323
  constructor(config) {
1324
+ this.order = 2 /* Normal */;
1605
1325
  let color = config.color;
1606
1326
  if (color.charAt(0) === "#") {
1607
1327
  color = color.substr(1);
@@ -1618,15 +1338,13 @@ var StaticColorBehavior = class {
1618
1338
  }
1619
1339
  }
1620
1340
  };
1341
+ StaticColorBehavior.type = "colorStatic";
1342
+ StaticColorBehavior.editorConfig = null;
1621
1343
 
1622
1344
  // particle/behaviors/OrderedTexture.ts
1623
1345
  var OrderedTextureBehavior = class {
1624
- static type = "textureOrdered";
1625
- static editorConfig = null;
1626
- order = 2 /* Normal */;
1627
- textures;
1628
- index;
1629
1346
  constructor(config) {
1347
+ this.order = 2 /* Normal */;
1630
1348
  this.index = 0;
1631
1349
  this.textures = config.textures.map((tex) => typeof tex === "string" ? GetTextureFromString(tex) : tex);
1632
1350
  }
@@ -1641,6 +1359,8 @@ var OrderedTextureBehavior = class {
1641
1359
  }
1642
1360
  }
1643
1361
  };
1362
+ OrderedTextureBehavior.type = "textureOrdered";
1363
+ OrderedTextureBehavior.editorConfig = null;
1644
1364
  var helperPoint = new Point();
1645
1365
  var MATH_FUNCS = [
1646
1366
  "E",
@@ -1703,17 +1423,9 @@ function parsePath(pathString) {
1703
1423
  return new Function("x", `return ${pathString};`);
1704
1424
  }
1705
1425
  var PathBehavior = class {
1706
- static type = "movePath";
1707
- static editorConfig = null;
1708
- // *MUST* happen after other behaviors do initialization so that we can read initial transformations
1709
- order = 5 /* Late */;
1710
- /**
1711
- * The function representing the path the particle should take.
1712
- */
1713
- path;
1714
- list;
1715
- minMult;
1716
1426
  constructor(config) {
1427
+ // *MUST* happen after other behaviors do initialization so that we can read initial transformations
1428
+ this.order = 5 /* Late */;
1717
1429
  if (config.path) {
1718
1430
  if (typeof config.path === "function") {
1719
1431
  this.path = config.path;
@@ -1756,24 +1468,25 @@ var PathBehavior = class {
1756
1468
  particle.position.y = particle.config.initPosition.y + helperPoint.y;
1757
1469
  }
1758
1470
  };
1471
+ PathBehavior.type = "movePath";
1472
+ PathBehavior.editorConfig = null;
1759
1473
 
1760
1474
  // particle/behaviors/PointSpawn.ts
1761
1475
  var PointSpawnBehavior = class {
1762
- static type = "spawnPoint";
1763
- static editorConfig = null;
1764
- order = 0 /* Spawn */;
1476
+ constructor() {
1477
+ this.order = 0 /* Spawn */;
1478
+ }
1765
1479
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1766
1480
  initParticles(_first) {
1767
1481
  }
1768
1482
  };
1483
+ PointSpawnBehavior.type = "spawnPoint";
1484
+ PointSpawnBehavior.editorConfig = null;
1769
1485
 
1770
1486
  // particle/behaviors/RandomTexture.ts
1771
1487
  var RandomTextureBehavior = class {
1772
- static type = "textureRandom";
1773
- static editorConfig = null;
1774
- order = 2 /* Normal */;
1775
- textures;
1776
1488
  constructor(config) {
1489
+ this.order = 2 /* Normal */;
1777
1490
  this.textures = config.textures.map((tex) => typeof tex === "string" ? GetTextureFromString(tex) : tex);
1778
1491
  }
1779
1492
  initParticles(first) {
@@ -1785,18 +1498,13 @@ var RandomTextureBehavior = class {
1785
1498
  }
1786
1499
  }
1787
1500
  };
1501
+ RandomTextureBehavior.type = "textureRandom";
1502
+ RandomTextureBehavior.editorConfig = null;
1788
1503
 
1789
1504
  // particle/behaviors/Rotation.ts
1790
1505
  var RotationBehavior = class {
1791
- static type = "rotation";
1792
- static editorConfig = null;
1793
- order = 2 /* Normal */;
1794
- minStart;
1795
- maxStart;
1796
- minSpeed;
1797
- maxSpeed;
1798
- accel;
1799
1506
  constructor(config) {
1507
+ this.order = 2 /* Normal */;
1800
1508
  this.minStart = config.minStart * DEG_TO_RADS;
1801
1509
  this.maxStart = config.maxStart * DEG_TO_RADS;
1802
1510
  this.minSpeed = config.minSpeed * DEG_TO_RADS;
@@ -1825,13 +1533,11 @@ var RotationBehavior = class {
1825
1533
  }
1826
1534
  }
1827
1535
  };
1536
+ RotationBehavior.type = "rotation";
1537
+ RotationBehavior.editorConfig = null;
1828
1538
  var StaticRotationBehavior = class {
1829
- static type = "rotationStatic";
1830
- static editorConfig = null;
1831
- order = 2 /* Normal */;
1832
- min;
1833
- max;
1834
1539
  constructor(config) {
1540
+ this.order = 2 /* Normal */;
1835
1541
  this.min = config.min * DEG_TO_RADS;
1836
1542
  this.max = config.max * DEG_TO_RADS;
1837
1543
  }
@@ -1847,12 +1553,11 @@ var StaticRotationBehavior = class {
1847
1553
  }
1848
1554
  }
1849
1555
  };
1556
+ StaticRotationBehavior.type = "rotationStatic";
1557
+ StaticRotationBehavior.editorConfig = null;
1850
1558
  var NoRotationBehavior = class {
1851
- static type = "noRotation";
1852
- static editorConfig = null;
1853
- order = 5 /* Late */ + 1;
1854
- rotation;
1855
1559
  constructor(config) {
1560
+ this.order = 5 /* Late */ + 1;
1856
1561
  this.rotation = (config.rotation || 0) * DEG_TO_RADS;
1857
1562
  }
1858
1563
  initParticles(first) {
@@ -1863,15 +1568,13 @@ var NoRotationBehavior = class {
1863
1568
  }
1864
1569
  }
1865
1570
  };
1571
+ NoRotationBehavior.type = "noRotation";
1572
+ NoRotationBehavior.editorConfig = null;
1866
1573
 
1867
1574
  // particle/behaviors/Scale.ts
1868
1575
  var ScaleBehavior = class {
1869
- static type = "scale";
1870
- static editorConfig = null;
1871
- order = 2 /* Normal */;
1872
- list;
1873
- minMult;
1874
1576
  constructor(config) {
1577
+ this.order = 2 /* Normal */;
1875
1578
  this.list = new PropertyList(false);
1876
1579
  this.list.reset(PropertyNode.createList(config.scale));
1877
1580
  this.minMult = config.minMult ?? 1;
@@ -1889,13 +1592,11 @@ var ScaleBehavior = class {
1889
1592
  particle.scale.x = particle.scale.y = this.list.interpolate(particle.agePercent) * particle.config.scaleMult;
1890
1593
  }
1891
1594
  };
1595
+ ScaleBehavior.type = "scale";
1596
+ ScaleBehavior.editorConfig = null;
1892
1597
  var StaticScaleBehavior = class {
1893
- static type = "scaleStatic";
1894
- static editorConfig = null;
1895
- order = 2 /* Normal */;
1896
- min;
1897
- max;
1898
1598
  constructor(config) {
1599
+ this.order = 2 /* Normal */;
1899
1600
  this.min = config.min;
1900
1601
  this.max = config.max;
1901
1602
  }
@@ -1908,15 +1609,19 @@ var StaticScaleBehavior = class {
1908
1609
  }
1909
1610
  }
1910
1611
  };
1612
+ StaticScaleBehavior.type = "scaleStatic";
1613
+ StaticScaleBehavior.editorConfig = null;
1911
1614
 
1912
1615
  // particle/behaviors/ShapeSpawn.ts
1913
- var ShapeSpawnBehavior = class _ShapeSpawnBehavior {
1914
- static type = "spawnShape";
1915
- static editorConfig = null;
1916
- /**
1917
- * Dictionary of all registered shape classes.
1918
- */
1919
- static shapes = {};
1616
+ var _ShapeSpawnBehavior = class _ShapeSpawnBehavior {
1617
+ constructor(config) {
1618
+ this.order = 0 /* Spawn */;
1619
+ const ShapeClass = _ShapeSpawnBehavior.shapes[config.type];
1620
+ if (!ShapeClass) {
1621
+ throw new Error(`No shape found with type '${config.type}'`);
1622
+ }
1623
+ this.shape = new ShapeClass(config.data);
1624
+ }
1920
1625
  /**
1921
1626
  * Registers a shape to be used by the ShapeSpawn behavior.
1922
1627
  * @param constructor The shape class constructor to use, with a static `type` property to reference it by.
@@ -1925,15 +1630,6 @@ var ShapeSpawnBehavior = class _ShapeSpawnBehavior {
1925
1630
  static registerShape(constructor, typeOverride) {
1926
1631
  _ShapeSpawnBehavior.shapes[typeOverride || constructor.type] = constructor;
1927
1632
  }
1928
- order = 0 /* Spawn */;
1929
- shape;
1930
- constructor(config) {
1931
- const ShapeClass = _ShapeSpawnBehavior.shapes[config.type];
1932
- if (!ShapeClass) {
1933
- throw new Error(`No shape found with type '${config.type}'`);
1934
- }
1935
- this.shape = new ShapeClass(config.data);
1936
- }
1937
1633
  initParticles(first) {
1938
1634
  let next = first;
1939
1635
  while (next) {
@@ -1942,6 +1638,13 @@ var ShapeSpawnBehavior = class _ShapeSpawnBehavior {
1942
1638
  }
1943
1639
  }
1944
1640
  };
1641
+ _ShapeSpawnBehavior.type = "spawnShape";
1642
+ _ShapeSpawnBehavior.editorConfig = null;
1643
+ /**
1644
+ * Dictionary of all registered shape classes.
1645
+ */
1646
+ _ShapeSpawnBehavior.shapes = {};
1647
+ var ShapeSpawnBehavior = _ShapeSpawnBehavior;
1945
1648
  ShapeSpawnBehavior.registerShape(PolygonalChain);
1946
1649
  ShapeSpawnBehavior.registerShape(Rectangle);
1947
1650
  ShapeSpawnBehavior.registerShape(Torus);
@@ -1949,11 +1652,8 @@ ShapeSpawnBehavior.registerShape(Torus, "circle");
1949
1652
 
1950
1653
  // particle/behaviors/SingleTexture.ts
1951
1654
  var SingleTextureBehavior = class {
1952
- static type = "textureSingle";
1953
- static editorConfig = null;
1954
- order = 2 /* Normal */;
1955
- texture;
1956
1655
  constructor(config) {
1656
+ this.order = 2 /* Normal */;
1957
1657
  this.texture = typeof config.texture === "string" ? GetTextureFromString(config.texture) : config.texture;
1958
1658
  }
1959
1659
  initParticles(first) {
@@ -1964,13 +1664,11 @@ var SingleTextureBehavior = class {
1964
1664
  }
1965
1665
  }
1966
1666
  };
1667
+ SingleTextureBehavior.type = "textureSingle";
1668
+ SingleTextureBehavior.editorConfig = null;
1967
1669
  var SpeedBehavior = class {
1968
- static type = "moveSpeed";
1969
- static editorConfig = null;
1970
- order = 5 /* Late */;
1971
- list;
1972
- minMult;
1973
1670
  constructor(config) {
1671
+ this.order = 5 /* Late */;
1974
1672
  this.list = new PropertyList(false);
1975
1673
  this.list.reset(PropertyNode.createList(config.speed));
1976
1674
  this.minMult = config.minMult ?? 1;
@@ -1998,13 +1696,11 @@ var SpeedBehavior = class {
1998
1696
  particle.y += vel.y * deltaSec;
1999
1697
  }
2000
1698
  };
1699
+ SpeedBehavior.type = "moveSpeed";
1700
+ SpeedBehavior.editorConfig = null;
2001
1701
  var StaticSpeedBehavior = class {
2002
- static type = "moveSpeedStatic";
2003
- static editorConfig = null;
2004
- order = 5 /* Late */;
2005
- min;
2006
- max;
2007
1702
  constructor(config) {
1703
+ this.order = 5 /* Late */;
2008
1704
  this.min = config.min;
2009
1705
  this.max = config.max;
2010
1706
  }
@@ -2027,14 +1723,13 @@ var StaticSpeedBehavior = class {
2027
1723
  particle.y += velocity.y * deltaSec;
2028
1724
  }
2029
1725
  };
1726
+ StaticSpeedBehavior.type = "moveSpeedStatic";
1727
+ StaticSpeedBehavior.editorConfig = null;
2030
1728
 
2031
1729
  // particle/behaviors/RandomColor.ts
2032
1730
  var RandomColor = class {
2033
- static type = "rngcolor";
2034
- static editorConfig;
2035
- order = 2 /* Normal */;
2036
- list;
2037
1731
  constructor(config) {
1732
+ this.order = 2 /* Normal */;
2038
1733
  this.list = config.colour.map((color) => hexToRGB(color));
2039
1734
  }
2040
1735
  initParticles(first) {
@@ -2048,14 +1743,12 @@ var RandomColor = class {
2048
1743
  }
2049
1744
  }
2050
1745
  };
1746
+ RandomColor.type = "rngcolor";
2051
1747
 
2052
1748
  // particle/behaviors/ZindexBehavior.ts
2053
1749
  var ZIndexBehavior = class {
2054
- static type = "zIndex";
2055
- static editorConfig;
2056
- order = 2 /* Normal */;
2057
- list;
2058
1750
  constructor(config) {
1751
+ this.order = 2 /* Normal */;
2059
1752
  this.list = new PropertyList(false);
2060
1753
  this.list.reset(PropertyNode.createList(config.zIndex));
2061
1754
  }
@@ -2069,6 +1762,7 @@ var ZIndexBehavior = class {
2069
1762
  particle.zIndex = this.list.interpolate(particle.agePercent);
2070
1763
  }
2071
1764
  };
1765
+ ZIndexBehavior.type = "zIndex";
2072
1766
  function getTextures2(textures) {
2073
1767
  const outTextures = [];
2074
1768
  for (let j = 0; j < textures.length; ++j) {
@@ -2102,12 +1796,8 @@ function parseAnimationState(state) {
2102
1796
  };
2103
1797
  }
2104
1798
  var MultiStateAnimatedTextureBehavior = class {
2105
- static type = "multiStateAnimated";
2106
- static editorConfig = null;
2107
- order = 2 /* Normal */;
2108
- sets;
2109
- initialState;
2110
1799
  constructor(config) {
1800
+ this.order = 2 /* Normal */;
2111
1801
  this.initialState = config.initialState || "default";
2112
1802
  this.sets = [];
2113
1803
  for (const set of config.sets) {
@@ -2174,18 +1864,13 @@ var MultiStateAnimatedTextureBehavior = class {
2174
1864
  particle.texture = anim.textures[frame] || anim.textures[anim.textures.length - 1] || Texture.EMPTY;
2175
1865
  }
2176
1866
  };
1867
+ MultiStateAnimatedTextureBehavior.type = "multiStateAnimated";
1868
+ MultiStateAnimatedTextureBehavior.editorConfig = null;
2177
1869
 
2178
1870
  // particle/behaviors/SpineTexture.ts
2179
1871
  var SpineAnimationBehavior = class {
2180
- static type = "spineAnimation";
2181
- static editorConfig = null;
2182
- order = 2 /* Normal */;
2183
- animation;
2184
- loop;
2185
- timeScale;
2186
- skin;
2187
- skins;
2188
1872
  constructor(config) {
1873
+ this.order = 2 /* Normal */;
2189
1874
  this.animation = config.animation;
2190
1875
  this.loop = config.loop ?? false;
2191
1876
  this.timeScale = config.timeScale ?? 1;
@@ -2223,13 +1908,11 @@ var SpineAnimationBehavior = class {
2223
1908
  updateParticle(_particle, _deltaSec) {
2224
1909
  }
2225
1910
  };
1911
+ SpineAnimationBehavior.type = "spineAnimation";
1912
+ SpineAnimationBehavior.editorConfig = null;
2226
1913
  var SpineRandomSkinBehavior = class {
2227
- static type = "spineRandomSkin";
2228
- static editorConfig = null;
2229
- order = 2 /* Normal */ - 1;
2230
- // Run before animation behavior
2231
- skins;
2232
1914
  constructor(config) {
1915
+ this.order = 2 /* Normal */ - 1;
2233
1916
  this.skins = config.skins;
2234
1917
  }
2235
1918
  initParticles(first) {
@@ -2246,16 +1929,11 @@ var SpineRandomSkinBehavior = class {
2246
1929
  }
2247
1930
  }
2248
1931
  };
1932
+ SpineRandomSkinBehavior.type = "spineRandomSkin";
1933
+ SpineRandomSkinBehavior.editorConfig = null;
2249
1934
  var SpineAnimationSequenceBehavior = class {
2250
- static type = "spineAnimationSequence";
2251
- static editorConfig = null;
2252
- order = 2 /* Normal */;
2253
- animationList;
2254
- loop;
2255
- timeScale;
2256
- skin;
2257
- skins;
2258
1935
  constructor(config) {
1936
+ this.order = 2 /* Normal */;
2259
1937
  this.animationList = config.animation.list;
2260
1938
  this.loop = config.loop ?? false;
2261
1939
  this.timeScale = config.timeScale ?? 1;
@@ -2311,6 +1989,8 @@ var SpineAnimationSequenceBehavior = class {
2311
1989
  }
2312
1990
  }
2313
1991
  };
1992
+ SpineAnimationSequenceBehavior.type = "spineAnimationSequence";
1993
+ SpineAnimationSequenceBehavior.editorConfig = null;
2314
1994
 
2315
1995
  // particle/EmitterConfig.ts
2316
1996
  function upgradeConfig(config, art) {
@@ -2665,45 +2345,6 @@ function upgradeConfig(config, art) {
2665
2345
  return out;
2666
2346
  }
2667
2347
  var SpineParticle = class extends Container {
2668
- /**
2669
- * The Spine instance for this particle.
2670
- */
2671
- spine;
2672
- /**
2673
- * The emitter that controls this particle.
2674
- * Using any to avoid circular dependency with SpineEmitter.
2675
- */
2676
- emitter;
2677
- /**
2678
- * The maximum lifetime of this particle, in seconds.
2679
- */
2680
- maxLife;
2681
- /**
2682
- * The current age of the particle, in seconds.
2683
- */
2684
- age;
2685
- /**
2686
- * The current age of the particle as a normalized value between 0 and 1.
2687
- */
2688
- agePercent;
2689
- /**
2690
- * One divided by the max life of the particle, saved for slightly faster math.
2691
- */
2692
- oneOverLife;
2693
- /**
2694
- * Reference to the next particle in the list.
2695
- */
2696
- next;
2697
- /**
2698
- * Reference to the previous particle in the list.
2699
- */
2700
- prev;
2701
- prevChild;
2702
- nextChild;
2703
- /**
2704
- * Static per-particle configuration for behaviors to use. Is not cleared when recycling.
2705
- */
2706
- config;
2707
2348
  /**
2708
2349
  * @param emitter The emitter that controls this particle.
2709
2350
  */
@@ -2769,14 +2410,6 @@ var SpineParticle = class extends Container {
2769
2410
  }
2770
2411
  };
2771
2412
  var SpineEmitter = class extends Emitter {
2772
- /**
2773
- * Skeleton asset key for creating Spine instances
2774
- */
2775
- skeletonKey;
2776
- /**
2777
- * Atlas asset key for creating Spine instances
2778
- */
2779
- atlasKey;
2780
2413
  constructor(particleParent, config) {
2781
2414
  const fullConfig = {
2782
2415
  ...config,