@tsparticles/editor
Version:
tsParticles Configuration Editor
41 lines (40 loc) • 1.59 kB
JavaScript
;
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;