UNPKG

@tsparticles/editor

Version:

tsParticles Configuration Editor

58 lines (57 loc) 2.15 kB
"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;