UNPKG

@tsparticles/plugin-canvas-mask

Version:

tsParticles canvas mask plugin

21 lines (20 loc) 600 B
import { isNull, loadProperty } from "@tsparticles/engine"; import { FontTextMask } from "./FontTextMask.js"; import { TextMaskLine } from "./TextMaskLine.js"; export class TextMask { color = "#000000"; fill = true; font = new FontTextMask(); lines = new TextMaskLine(); text = ""; load(data) { if (isNull(data)) { return; } loadProperty(this, "color", data.color); loadProperty(this, "fill", data.fill); this.font.load(data.font); this.lines.load(data.lines); loadProperty(this, "text", data.text); } }