@tsparticles/plugin-polygon-mask
Version:
tsParticles polygon mask plugin
33 lines (32 loc) • 1.19 kB
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", "./PolygonMaskDrawStroke.js"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PolygonMaskDraw = void 0;
const engine_1 = require("@tsparticles/engine");
const PolygonMaskDrawStroke_js_1 = require("./PolygonMaskDrawStroke.js");
class PolygonMaskDraw {
constructor(engine) {
this.enable = false;
this.stroke = new PolygonMaskDrawStroke_js_1.PolygonMaskDrawStroke(engine);
}
load(data) {
if ((0, engine_1.isNull)(data)) {
return;
}
if (data.enable !== undefined) {
this.enable = data.enable;
}
const stroke = data.stroke;
this.stroke.load(stroke);
}
}
exports.PolygonMaskDraw = PolygonMaskDraw;
});