@tsparticles/editor
Version:
tsParticles Configuration Editor
37 lines (36 loc) • 1.34 kB
JavaScript
import { EditorType } from "object-gui";
import { EditorBase } from "../../../../EditorBase";
export class NumberOptionsEditor extends 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", EditorType.number).change(() => {
void this.particles().refresh();
});
group.addProperty("enable", "Enable", EditorType.boolean).change(() => {
void this.particles().refresh();
});
group.addProperty("factor", "Factor", EditorType.number).change(() => {
void this.particles().refresh();
});
}
addProperties() {
this.group.addProperty("limit", "Limit", EditorType.number).change(() => {
void this.particles().refresh();
});
this.group.addProperty("max", "Max", EditorType.number).change(() => {
void this.particles().refresh();
});
this.group.addProperty("value", "Value", EditorType.number).change(() => {
void this.particles().refresh();
});
}
}