UNPKG

@tsparticles/editor

Version:

tsParticles Configuration Editor

68 lines (67 loc) 2.79 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", "object-gui", "../../../../EditorBase"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RotateOptionsEditor = void 0; const engine_1 = require("@tsparticles/engine"); const object_gui_1 = require("object-gui"); const EditorBase_1 = require("../../../../EditorBase"); class RotateOptionsEditor extends EditorBase_1.EditorBase { constructor(particles) { super(particles); } addToGroup(parent) { this.group = parent.addGroup("rotate", "Rotate"); this.options = this.group.data; this.addAnimation(); this.addProperties(); } addAnimation() { const group = this.group.addGroup("animation", "Animation"); group.addProperty("enable", "Enable", object_gui_1.EditorType.boolean).change(() => { void this.particles().refresh(); }); group.addProperty("speed", "Speed", object_gui_1.EditorType.number).change(() => { void this.particles().refresh(); }); group.addProperty("sync", "Sync", object_gui_1.EditorType.boolean).change(() => { void this.particles().refresh(); }); } addProperties() { this.group .addProperty("direction", "Direction", object_gui_1.EditorType.select) .change(() => { void this.particles().refresh(); }) .addItems([ { value: engine_1.RotateDirection.clockwise, }, { value: engine_1.RotateDirection.counterClockwise, }, { value: engine_1.RotateDirection.random, }, ]); this.group.addProperty("path", "Path", object_gui_1.EditorType.boolean).change(() => { void this.particles().refresh(); }); this.group.addProperty("random", "Random", object_gui_1.EditorType.boolean).change(() => { void this.particles().refresh(); }); this.group.addProperty("value", "Value", object_gui_1.EditorType.number).change(() => { void this.particles().refresh(); }); } } exports.RotateOptionsEditor = RotateOptionsEditor; });