42 lines
1.5 KiB
JavaScript
42 lines
1.5 KiB
JavaScript
(function (factory) {
|
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
var v = factory(require, exports);
|
|
if (v !== undefined) module.exports = v;
|
|
}
|
|
else if (typeof define === "function" && define.amd) {
|
|
define(["require", "exports", "tsparticles-engine", "./SplitFactor", "./SplitRate"], factory);
|
|
}
|
|
})(function (require, exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.Split = void 0;
|
|
const tsparticles_engine_1 = require("tsparticles-engine");
|
|
const SplitFactor_1 = require("./SplitFactor");
|
|
const SplitRate_1 = require("./SplitRate");
|
|
class Split {
|
|
constructor() {
|
|
this.count = 1;
|
|
this.factor = new SplitFactor_1.SplitFactor();
|
|
this.rate = new SplitRate_1.SplitRate();
|
|
this.sizeOffset = true;
|
|
}
|
|
load(data) {
|
|
if (!data) {
|
|
return;
|
|
}
|
|
if (data.count !== undefined) {
|
|
this.count = data.count;
|
|
}
|
|
this.factor.load(data.factor);
|
|
this.rate.load(data.rate);
|
|
this.particles = (0, tsparticles_engine_1.executeOnSingleOrMultiple)(data.particles, (particles) => {
|
|
return (0, tsparticles_engine_1.deepExtend)({}, particles);
|
|
});
|
|
if (data.sizeOffset !== undefined) {
|
|
this.sizeOffset = data.sizeOffset;
|
|
}
|
|
}
|
|
}
|
|
exports.Split = Split;
|
|
});
|