@tsparticles/confetti 3.0.0-beta.1 → 3.0.0-beta.3
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 +22 -22
- package/package.json +19 -19
- package/report.html +23 -5
- package/tsparticles.confetti.bundle.js +147 -96
- package/tsparticles.confetti.bundle.min.js +1 -1
- package/tsparticles.confetti.bundle.min.js.LICENSE.txt +1 -1
- package/tsparticles.confetti.js +1 -1
- package/tsparticles.confetti.min.js.LICENSE.txt +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-beta.
|
|
7
|
+
* v3.0.0-beta.3
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -206,6 +206,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
206
206
|
rectBounce: () => (/* reexport */ rectBounce),
|
|
207
207
|
resizeEvent: () => (/* reexport */ resizeEvent),
|
|
208
208
|
rgbToHsl: () => (/* reexport */ rgbToHsl),
|
|
209
|
+
safeIntersectionObserver: () => (/* reexport */ safeIntersectionObserver),
|
|
209
210
|
safeMatchMedia: () => (/* reexport */ safeMatchMedia),
|
|
210
211
|
safeMutationObserver: () => (/* reexport */ safeMutationObserver),
|
|
211
212
|
setLogger: () => (/* reexport */ setLogger),
|
|
@@ -572,6 +573,12 @@ function safeMatchMedia(query) {
|
|
|
572
573
|
}
|
|
573
574
|
return matchMedia(query);
|
|
574
575
|
}
|
|
576
|
+
function safeIntersectionObserver(callback) {
|
|
577
|
+
if (isSsr() || typeof IntersectionObserver === "undefined") {
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
return new IntersectionObserver(callback);
|
|
581
|
+
}
|
|
575
582
|
function safeMutationObserver(callback) {
|
|
576
583
|
if (isSsr() || typeof MutationObserver === "undefined") {
|
|
577
584
|
return;
|
|
@@ -1231,7 +1238,15 @@ function drawParticle(data) {
|
|
|
1231
1238
|
if (colorStyles.stroke) {
|
|
1232
1239
|
context.strokeStyle = colorStyles.stroke;
|
|
1233
1240
|
}
|
|
1234
|
-
|
|
1241
|
+
const drawData = {
|
|
1242
|
+
container,
|
|
1243
|
+
context,
|
|
1244
|
+
particle,
|
|
1245
|
+
radius,
|
|
1246
|
+
opacity,
|
|
1247
|
+
delta
|
|
1248
|
+
};
|
|
1249
|
+
drawShape(drawData);
|
|
1235
1250
|
if (strokeWidth > 0) {
|
|
1236
1251
|
context.stroke();
|
|
1237
1252
|
}
|
|
@@ -1241,11 +1256,19 @@ function drawParticle(data) {
|
|
|
1241
1256
|
if (particle.fill) {
|
|
1242
1257
|
context.fill();
|
|
1243
1258
|
}
|
|
1244
|
-
drawShapeAfterEffect(
|
|
1259
|
+
drawShapeAfterEffect(drawData);
|
|
1245
1260
|
context.globalCompositeOperation = "source-over";
|
|
1246
1261
|
context.setTransform(1, 0, 0, 1, 0, 0);
|
|
1247
1262
|
}
|
|
1248
|
-
function drawShape(
|
|
1263
|
+
function drawShape(data) {
|
|
1264
|
+
const {
|
|
1265
|
+
container,
|
|
1266
|
+
context,
|
|
1267
|
+
particle,
|
|
1268
|
+
radius,
|
|
1269
|
+
opacity,
|
|
1270
|
+
delta
|
|
1271
|
+
} = data;
|
|
1249
1272
|
if (!particle.shape) {
|
|
1250
1273
|
return;
|
|
1251
1274
|
}
|
|
@@ -1253,9 +1276,24 @@ function drawShape(container, context, particle, radius, opacity, delta) {
|
|
|
1253
1276
|
if (!drawer) {
|
|
1254
1277
|
return;
|
|
1255
1278
|
}
|
|
1256
|
-
drawer.draw(
|
|
1279
|
+
drawer.draw({
|
|
1280
|
+
context,
|
|
1281
|
+
particle,
|
|
1282
|
+
radius,
|
|
1283
|
+
opacity,
|
|
1284
|
+
delta,
|
|
1285
|
+
pixelRatio: container.retina.pixelRatio
|
|
1286
|
+
});
|
|
1257
1287
|
}
|
|
1258
|
-
function drawShapeAfterEffect(
|
|
1288
|
+
function drawShapeAfterEffect(data) {
|
|
1289
|
+
const {
|
|
1290
|
+
container,
|
|
1291
|
+
context,
|
|
1292
|
+
particle,
|
|
1293
|
+
radius,
|
|
1294
|
+
opacity,
|
|
1295
|
+
delta
|
|
1296
|
+
} = data;
|
|
1259
1297
|
if (!particle.shape) {
|
|
1260
1298
|
return;
|
|
1261
1299
|
}
|
|
@@ -1263,7 +1301,14 @@ function drawShapeAfterEffect(container, context, particle, radius, opacity, del
|
|
|
1263
1301
|
if (!drawer || !drawer.afterEffect) {
|
|
1264
1302
|
return;
|
|
1265
1303
|
}
|
|
1266
|
-
drawer.afterEffect(
|
|
1304
|
+
drawer.afterEffect({
|
|
1305
|
+
context,
|
|
1306
|
+
particle,
|
|
1307
|
+
radius,
|
|
1308
|
+
opacity,
|
|
1309
|
+
delta,
|
|
1310
|
+
pixelRatio: container.retina.pixelRatio
|
|
1311
|
+
});
|
|
1267
1312
|
}
|
|
1268
1313
|
function drawPlugin(context, plugin, delta) {
|
|
1269
1314
|
if (!plugin.draw) {
|
|
@@ -3647,7 +3692,17 @@ class InteractionManager {
|
|
|
3647
3692
|
|
|
3648
3693
|
|
|
3649
3694
|
|
|
3650
|
-
|
|
3695
|
+
function loadShapeData(shape, shapeOptions, id, reduceDuplicates) {
|
|
3696
|
+
const shapeData = shapeOptions.options[shape];
|
|
3697
|
+
if (!shapeData) {
|
|
3698
|
+
return;
|
|
3699
|
+
}
|
|
3700
|
+
return deepExtend({
|
|
3701
|
+
close: shapeOptions.close,
|
|
3702
|
+
fill: shapeOptions.fill
|
|
3703
|
+
}, itemFromSingleOrMultiple(shapeData, id, reduceDuplicates));
|
|
3704
|
+
}
|
|
3705
|
+
function fixOutMode(data) {
|
|
3651
3706
|
if (!isInArray(data.outMode, data.checkModes)) {
|
|
3652
3707
|
return;
|
|
3653
3708
|
}
|
|
@@ -3657,7 +3712,7 @@ const fixOutMode = data => {
|
|
|
3657
3712
|
} else if (data.coord < diameter) {
|
|
3658
3713
|
data.setCb(data.radius);
|
|
3659
3714
|
}
|
|
3660
|
-
}
|
|
3715
|
+
}
|
|
3661
3716
|
class Particle {
|
|
3662
3717
|
constructor(engine, id, container, position, overrideOptions, group) {
|
|
3663
3718
|
this.container = container;
|
|
@@ -3782,16 +3837,6 @@ class Particle {
|
|
|
3782
3837
|
}
|
|
3783
3838
|
this.offset = Vector.origin;
|
|
3784
3839
|
};
|
|
3785
|
-
this._loadShapeData = (shapeOptions, reduceDuplicates) => {
|
|
3786
|
-
const shapeData = shapeOptions.options[this.shape];
|
|
3787
|
-
if (!shapeData) {
|
|
3788
|
-
return;
|
|
3789
|
-
}
|
|
3790
|
-
return deepExtend({
|
|
3791
|
-
close: shapeOptions.close,
|
|
3792
|
-
fill: shapeOptions.fill
|
|
3793
|
-
}, itemFromSingleOrMultiple(shapeData, this.id, reduceDuplicates));
|
|
3794
|
-
};
|
|
3795
3840
|
this._engine = engine;
|
|
3796
3841
|
this.init(id, position, overrideOptions, group);
|
|
3797
3842
|
}
|
|
@@ -3880,7 +3925,7 @@ class Particle {
|
|
|
3880
3925
|
shapeOptions.load(overrideOptions.shape);
|
|
3881
3926
|
}
|
|
3882
3927
|
}
|
|
3883
|
-
this.shapeData = this.
|
|
3928
|
+
this.shapeData = loadShapeData(this.shape, shapeOptions, this.id, reduceDuplicates);
|
|
3884
3929
|
particlesOptions.load(overrideOptions);
|
|
3885
3930
|
const shapeData = this.shapeData;
|
|
3886
3931
|
if (shapeData) {
|
|
@@ -4191,8 +4236,9 @@ class Particles {
|
|
|
4191
4236
|
return false;
|
|
4192
4237
|
}
|
|
4193
4238
|
particle.destroy(override);
|
|
4239
|
+
const zIdx = this._zArray.indexOf(particle);
|
|
4194
4240
|
this._array.splice(index, 1);
|
|
4195
|
-
this._zArray
|
|
4241
|
+
this._zArray.splice(zIdx, 1);
|
|
4196
4242
|
this.pool.push(particle);
|
|
4197
4243
|
this._engine.dispatchEvent("particleRemoved", {
|
|
4198
4244
|
container: this._container,
|
|
@@ -4299,7 +4345,7 @@ class Particles {
|
|
|
4299
4345
|
this.addManualParticles();
|
|
4300
4346
|
if (!handled) {
|
|
4301
4347
|
const particlesOptions = options.particles,
|
|
4302
|
-
groups =
|
|
4348
|
+
groups = particlesOptions.groups;
|
|
4303
4349
|
for (const group in groups) {
|
|
4304
4350
|
const groupOptions = groups[group];
|
|
4305
4351
|
for (let i = this.count, j = 0; j < groupOptions.number?.value && i < particlesOptions.number.value; i++, j++) {
|
|
@@ -4475,7 +4521,6 @@ function loadContainerOptions(engine, container, ...sourceOptionsArr) {
|
|
|
4475
4521
|
}
|
|
4476
4522
|
class Container {
|
|
4477
4523
|
constructor(engine, id, sourceOptions) {
|
|
4478
|
-
this.id = id;
|
|
4479
4524
|
this._intersectionManager = entries => {
|
|
4480
4525
|
if (!guardCheck(this) || !this.actualOptions.pauseOnOutsideViewport) {
|
|
4481
4526
|
return;
|
|
@@ -4514,6 +4559,7 @@ class Container {
|
|
|
4514
4559
|
}
|
|
4515
4560
|
};
|
|
4516
4561
|
this._engine = engine;
|
|
4562
|
+
this.id = Symbol(id);
|
|
4517
4563
|
this.fpsLimit = 120;
|
|
4518
4564
|
this.smooth = false;
|
|
4519
4565
|
this._delay = 0;
|
|
@@ -4543,9 +4589,7 @@ class Container {
|
|
|
4543
4589
|
this._options = loadContainerOptions(this._engine, this);
|
|
4544
4590
|
this.actualOptions = loadContainerOptions(this._engine, this);
|
|
4545
4591
|
this._eventListeners = new EventListeners(this);
|
|
4546
|
-
|
|
4547
|
-
this._intersectionObserver = new IntersectionObserver(entries => this._intersectionManager(entries));
|
|
4548
|
-
}
|
|
4592
|
+
this._intersectionObserver = safeIntersectionObserver(entries => this._intersectionManager(entries));
|
|
4549
4593
|
this._engine.dispatchEvent("containerBuilt", {
|
|
4550
4594
|
container: this
|
|
4551
4595
|
});
|
|
@@ -4988,17 +5032,17 @@ class Engine {
|
|
|
4988
5032
|
return res;
|
|
4989
5033
|
}
|
|
4990
5034
|
get version() {
|
|
4991
|
-
return "3.0.0-beta.
|
|
5035
|
+
return "3.0.0-beta.3";
|
|
4992
5036
|
}
|
|
4993
|
-
addConfig(
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
5037
|
+
addConfig(config) {
|
|
5038
|
+
const name = config.name ?? "default";
|
|
5039
|
+
this._configs.set(name, config);
|
|
5040
|
+
this._eventDispatcher.dispatchEvent("configAdded", {
|
|
5041
|
+
data: {
|
|
5042
|
+
name,
|
|
5043
|
+
config
|
|
4998
5044
|
}
|
|
4999
|
-
}
|
|
5000
|
-
this._configs.set(nameOrConfig.name ?? "default", nameOrConfig);
|
|
5001
|
-
}
|
|
5045
|
+
});
|
|
5002
5046
|
}
|
|
5003
5047
|
addEventListener(type, listener) {
|
|
5004
5048
|
this._eventDispatcher.addEventListener(type, listener);
|
|
@@ -5027,44 +5071,11 @@ class Engine {
|
|
|
5027
5071
|
(override || !this.getPreset(preset)) && this.presets.set(preset, options);
|
|
5028
5072
|
await this.refresh(refresh);
|
|
5029
5073
|
}
|
|
5030
|
-
async addShape(shape, drawer,
|
|
5031
|
-
let customDrawer;
|
|
5032
|
-
let realRefresh = refresh,
|
|
5033
|
-
realInit,
|
|
5034
|
-
realAfterEffect,
|
|
5035
|
-
realDestroy;
|
|
5036
|
-
if (isBoolean(initOrRefresh)) {
|
|
5037
|
-
realRefresh = initOrRefresh;
|
|
5038
|
-
realInit = undefined;
|
|
5039
|
-
} else {
|
|
5040
|
-
realInit = initOrRefresh;
|
|
5041
|
-
}
|
|
5042
|
-
if (isBoolean(afterEffectOrRefresh)) {
|
|
5043
|
-
realRefresh = afterEffectOrRefresh;
|
|
5044
|
-
realAfterEffect = undefined;
|
|
5045
|
-
} else {
|
|
5046
|
-
realAfterEffect = afterEffectOrRefresh;
|
|
5047
|
-
}
|
|
5048
|
-
if (isBoolean(destroyOrRefresh)) {
|
|
5049
|
-
realRefresh = destroyOrRefresh;
|
|
5050
|
-
realDestroy = undefined;
|
|
5051
|
-
} else {
|
|
5052
|
-
realDestroy = destroyOrRefresh;
|
|
5053
|
-
}
|
|
5054
|
-
if (isFunction(drawer)) {
|
|
5055
|
-
customDrawer = {
|
|
5056
|
-
afterEffect: realAfterEffect,
|
|
5057
|
-
destroy: realDestroy,
|
|
5058
|
-
draw: drawer,
|
|
5059
|
-
init: realInit
|
|
5060
|
-
};
|
|
5061
|
-
} else {
|
|
5062
|
-
customDrawer = drawer;
|
|
5063
|
-
}
|
|
5074
|
+
async addShape(shape, drawer, refresh = true) {
|
|
5064
5075
|
executeOnSingleOrMultiple(shape, type => {
|
|
5065
|
-
!this.getShapeDrawer(type) && this.drawers.set(type,
|
|
5076
|
+
!this.getShapeDrawer(type) && this.drawers.set(type, drawer);
|
|
5066
5077
|
});
|
|
5067
|
-
await this.refresh(
|
|
5078
|
+
await this.refresh(refresh);
|
|
5068
5079
|
}
|
|
5069
5080
|
clearPlugins(container) {
|
|
5070
5081
|
this.updaters.delete(container);
|
|
@@ -5142,7 +5153,7 @@ class Engine {
|
|
|
5142
5153
|
}
|
|
5143
5154
|
const currentOptions = itemFromSingleOrMultiple(options, index),
|
|
5144
5155
|
dom = this.dom(),
|
|
5145
|
-
oldIndex = dom.findIndex(v => v.id === id);
|
|
5156
|
+
oldIndex = dom.findIndex(v => v.id.description === id);
|
|
5146
5157
|
if (oldIndex >= 0) {
|
|
5147
5158
|
const old = this.domItem(oldIndex);
|
|
5148
5159
|
if (old && !old.destroyed) {
|
|
@@ -5733,7 +5744,12 @@ async function loadBaseMover(engine, refresh = true) {
|
|
|
5733
5744
|
;// CONCATENATED MODULE: ../../shapes/circle/dist/browser/CircleDrawer.js
|
|
5734
5745
|
|
|
5735
5746
|
class CircleDrawer {
|
|
5736
|
-
draw(
|
|
5747
|
+
draw(data) {
|
|
5748
|
+
const {
|
|
5749
|
+
context,
|
|
5750
|
+
particle,
|
|
5751
|
+
radius
|
|
5752
|
+
} = data;
|
|
5737
5753
|
if (!particle.circleRange) {
|
|
5738
5754
|
particle.circleRange = {
|
|
5739
5755
|
min: 0,
|
|
@@ -6428,18 +6444,22 @@ async function loadBasic(engine, refresh = true) {
|
|
|
6428
6444
|
await engine.refresh(refresh);
|
|
6429
6445
|
}
|
|
6430
6446
|
;// CONCATENATED MODULE: ../../shapes/cards/dist/browser/Utils.js
|
|
6431
|
-
function drawPath(
|
|
6447
|
+
function drawPath(data, path) {
|
|
6432
6448
|
if (!path.segments.length || !path.segments[0].values.length) {
|
|
6433
6449
|
return;
|
|
6434
6450
|
}
|
|
6435
|
-
|
|
6451
|
+
const {
|
|
6452
|
+
context,
|
|
6453
|
+
radius
|
|
6454
|
+
} = data;
|
|
6455
|
+
context.moveTo(path.segments[0].values[0].x * radius, path.segments[0].values[0].y * radius);
|
|
6436
6456
|
for (let i = 0; i < path.segments.length; i++) {
|
|
6437
6457
|
const segment = path.segments[i];
|
|
6438
|
-
|
|
6458
|
+
context.bezierCurveTo(segment.values[1].x * radius, segment.values[1].y * radius, segment.values[2].x * radius, segment.values[2].y * radius, segment.values[3].x * radius, segment.values[3].y * radius);
|
|
6439
6459
|
}
|
|
6440
6460
|
for (let i = path.segments.length - 1; i >= 0; i--) {
|
|
6441
6461
|
const segment = path.segments[i];
|
|
6442
|
-
|
|
6462
|
+
context.bezierCurveTo(-segment.values[2].x * radius, segment.values[2].y * radius, -segment.values[1].x * radius, segment.values[1].y * radius, -segment.values[0].x * radius, segment.values[0].y * radius);
|
|
6443
6463
|
}
|
|
6444
6464
|
}
|
|
6445
6465
|
const n = 1.0 / 2;
|
|
@@ -6684,23 +6704,23 @@ const paths = {
|
|
|
6684
6704
|
;// CONCATENATED MODULE: ../../shapes/cards/dist/browser/CardsSuitsDrawers.js
|
|
6685
6705
|
|
|
6686
6706
|
class SpadeDrawer {
|
|
6687
|
-
draw(
|
|
6688
|
-
drawPath(
|
|
6707
|
+
draw(data) {
|
|
6708
|
+
drawPath(data, paths.spade);
|
|
6689
6709
|
}
|
|
6690
6710
|
}
|
|
6691
6711
|
class HeartDrawer {
|
|
6692
|
-
draw(
|
|
6693
|
-
drawPath(
|
|
6712
|
+
draw(data) {
|
|
6713
|
+
drawPath(data, paths.heart);
|
|
6694
6714
|
}
|
|
6695
6715
|
}
|
|
6696
6716
|
class DiamondDrawer {
|
|
6697
|
-
draw(
|
|
6698
|
-
drawPath(
|
|
6717
|
+
draw(data) {
|
|
6718
|
+
drawPath(data, paths.diamond);
|
|
6699
6719
|
}
|
|
6700
6720
|
}
|
|
6701
6721
|
class ClubDrawer {
|
|
6702
|
-
draw(
|
|
6703
|
-
drawPath(
|
|
6722
|
+
draw(data) {
|
|
6723
|
+
drawPath(data, paths.club);
|
|
6704
6724
|
}
|
|
6705
6725
|
}
|
|
6706
6726
|
;// CONCATENATED MODULE: ../../shapes/cards/dist/browser/index.js
|
|
@@ -7395,7 +7415,11 @@ async function loadEmittersPlugin(engine, refresh = true) {
|
|
|
7395
7415
|
|
|
7396
7416
|
;// CONCATENATED MODULE: ../../shapes/heart/dist/browser/HeartDrawer.js
|
|
7397
7417
|
class HeartDrawer_HeartDrawer {
|
|
7398
|
-
draw(
|
|
7418
|
+
draw(data) {
|
|
7419
|
+
const {
|
|
7420
|
+
context,
|
|
7421
|
+
radius
|
|
7422
|
+
} = data;
|
|
7399
7423
|
const x = -radius,
|
|
7400
7424
|
y = -radius;
|
|
7401
7425
|
context.moveTo(x, y + radius / 2);
|
|
@@ -7965,8 +7989,15 @@ class ImageDrawer {
|
|
|
7965
7989
|
}
|
|
7966
7990
|
this._engine.images.push(image);
|
|
7967
7991
|
}
|
|
7968
|
-
draw(
|
|
7969
|
-
const
|
|
7992
|
+
draw(data) {
|
|
7993
|
+
const {
|
|
7994
|
+
context,
|
|
7995
|
+
radius,
|
|
7996
|
+
particle,
|
|
7997
|
+
opacity,
|
|
7998
|
+
delta
|
|
7999
|
+
} = data,
|
|
8000
|
+
image = particle.image,
|
|
7970
8001
|
element = image?.element;
|
|
7971
8002
|
if (!image) {
|
|
7972
8003
|
return;
|
|
@@ -8507,8 +8538,13 @@ async function loadMotionPlugin(engine, refresh = true) {
|
|
|
8507
8538
|
;// CONCATENATED MODULE: ../../shapes/polygon/dist/browser/PolygonDrawerBase.js
|
|
8508
8539
|
|
|
8509
8540
|
class PolygonDrawerBase {
|
|
8510
|
-
draw(
|
|
8511
|
-
const
|
|
8541
|
+
draw(data) {
|
|
8542
|
+
const {
|
|
8543
|
+
context,
|
|
8544
|
+
particle,
|
|
8545
|
+
radius
|
|
8546
|
+
} = data,
|
|
8547
|
+
start = this.getCenter(particle, radius),
|
|
8512
8548
|
side = this.getSidesData(particle, radius),
|
|
8513
8549
|
sideCount = side.count.numerator * side.count.denominator,
|
|
8514
8550
|
decimalSides = side.count.numerator / side.count.denominator,
|
|
@@ -8886,8 +8922,12 @@ async function loadRotateUpdater(engine, refresh = true) {
|
|
|
8886
8922
|
;// CONCATENATED MODULE: ../../shapes/square/dist/browser/SquareDrawer.js
|
|
8887
8923
|
const fixFactor = Math.sqrt(2);
|
|
8888
8924
|
class SquareDrawer {
|
|
8889
|
-
draw(
|
|
8890
|
-
const
|
|
8925
|
+
draw(data) {
|
|
8926
|
+
const {
|
|
8927
|
+
context,
|
|
8928
|
+
radius
|
|
8929
|
+
} = data,
|
|
8930
|
+
fixedRadius = radius / fixFactor,
|
|
8891
8931
|
fixedDiameter = fixedRadius * 2;
|
|
8892
8932
|
context.rect(-fixedRadius, -fixedRadius, fixedDiameter, fixedDiameter);
|
|
8893
8933
|
}
|
|
@@ -8903,8 +8943,13 @@ async function loadSquareShape(engine, refresh = true) {
|
|
|
8903
8943
|
;// CONCATENATED MODULE: ../../shapes/star/dist/browser/StarDrawer.js
|
|
8904
8944
|
|
|
8905
8945
|
class StarDrawer {
|
|
8906
|
-
draw(
|
|
8907
|
-
const
|
|
8946
|
+
draw(data) {
|
|
8947
|
+
const {
|
|
8948
|
+
context,
|
|
8949
|
+
particle,
|
|
8950
|
+
radius
|
|
8951
|
+
} = data,
|
|
8952
|
+
sides = particle.sides,
|
|
8908
8953
|
inset = particle.starInset ?? 2;
|
|
8909
8954
|
context.moveTo(0, 0 - radius);
|
|
8910
8955
|
for (let i = 0; i < sides; i++) {
|
|
@@ -8932,8 +8977,14 @@ async function loadStarShape(engine, refresh = true) {
|
|
|
8932
8977
|
|
|
8933
8978
|
const validTypes = ["text", "character", "char"];
|
|
8934
8979
|
class TextDrawer {
|
|
8935
|
-
draw(
|
|
8936
|
-
const
|
|
8980
|
+
draw(data) {
|
|
8981
|
+
const {
|
|
8982
|
+
context,
|
|
8983
|
+
particle,
|
|
8984
|
+
radius,
|
|
8985
|
+
opacity
|
|
8986
|
+
} = data,
|
|
8987
|
+
character = particle.shapeData;
|
|
8937
8988
|
if (character === undefined) {
|
|
8938
8989
|
return;
|
|
8939
8990
|
}
|