UNPKG

@tsparticles/plugin-emitters-shape-canvas

Version:

tsParticles emitters shape canvas plugin

39 lines (38 loc) 1.42 kB
(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", "./TextFontOptions.js", "./TextLinesOptions.js"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TextOptions = void 0; const engine_1 = require("@tsparticles/engine"); const TextFontOptions_js_1 = require("./TextFontOptions.js"); const TextLinesOptions_js_1 = require("./TextLinesOptions.js"); class TextOptions { constructor() { this.color = "#000000"; this.font = new TextFontOptions_js_1.TextFontOptions(); this.lines = new TextLinesOptions_js_1.TextLinesOptions(); this.text = ""; } load(data) { if ((0, engine_1.isNull)(data)) { return; } if (data.color !== undefined) { this.color = data.color; } this.font.load(data.font); this.lines.load(data.lines); if (data.text !== undefined) { this.text = data.text; } } } exports.TextOptions = TextOptions; });