UNPKG

@tsparticles/editor

Version:

tsParticles Configuration Editor

57 lines (56 loc) 2.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TiltOptionsEditor = void 0; const object_gui_1 = require("object-gui"); const EditorBase_1 = require("../../../../EditorBase"); class TiltOptionsEditor extends EditorBase_1.EditorBase { constructor(particles) { super(particles); } addToGroup(parent) { this.group = parent.addGroup("tilt", "Tilt"); 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: "clockwise", }, { value: "counterClockwise", }, { value: "random", }, ]); this.group.addProperty("enable", "Enable", 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.TiltOptionsEditor = TiltOptionsEditor;