@tsparticles/editor
Version:
tsParticles Configuration Editor
51 lines (50 loc) • 2.14 kB
JavaScript
(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", "object-gui", "../../../../EditorBase"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NumberOptionsEditor = void 0;
const object_gui_1 = require("object-gui");
const EditorBase_1 = require("../../../../EditorBase");
class NumberOptionsEditor extends EditorBase_1.EditorBase {
constructor(particles) {
super(particles);
}
addToGroup(parent) {
this.group = parent.addGroup("number", "Number");
this.options = this.group.data;
this.addDensity();
this.addProperties();
}
addDensity() {
const group = this.group.addGroup("density", "Density");
group.addProperty("area", "Area", object_gui_1.EditorType.number).change(() => {
void this.particles().refresh();
});
group.addProperty("enable", "Enable", object_gui_1.EditorType.boolean).change(() => {
void this.particles().refresh();
});
group.addProperty("factor", "Factor", object_gui_1.EditorType.number).change(() => {
void this.particles().refresh();
});
}
addProperties() {
this.group.addProperty("limit", "Limit", object_gui_1.EditorType.number).change(() => {
void this.particles().refresh();
});
this.group.addProperty("max", "Max", object_gui_1.EditorType.number).change(() => {
void this.particles().refresh();
});
this.group.addProperty("value", "Value", object_gui_1.EditorType.number).change(() => {
void this.particles().refresh();
});
}
}
exports.NumberOptionsEditor = NumberOptionsEditor;
});