@tsparticles/plugin-canvas-mask
Version:
tsParticles canvas mask plugin
42 lines (41 loc) • 1.34 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"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FontTextMask = void 0;
const engine_1 = require("@tsparticles/engine");
class FontTextMask {
constructor() {
this.family = "sans-serif";
this.size = 100;
}
load(data) {
if ((0, engine_1.isNull)(data)) {
return;
}
if (data.family !== undefined) {
this.family = data.family;
}
if (data.size !== undefined) {
this.size = data.size;
}
if (data.style !== undefined) {
this.style = data.style;
}
if (data.variant !== undefined) {
this.variant = data.variant;
}
if (data.weight !== undefined) {
this.weight = data.weight;
}
}
}
exports.FontTextMask = FontTextMask;
});