@tsparticles/editor
Version:
tsParticles Configuration Editor
31 lines (30 loc) • 988 B
JavaScript
import { EditorType } from "object-gui";
import { EditorBase } from "../../../EditorBase";
export class MotionOptionsEditor extends EditorBase {
constructor(particles) {
super(particles);
}
addToGroup(parent) {
this.group = parent.addGroup("motion", "Motion");
this.options = this.group.data;
this.addReduce();
this.addProperties();
}
addProperties() {
this.group.addProperty("disable", "Disable", EditorType.boolean).change(() => {
void this.particles().refresh();
});
}
addReduce() {
const coverGroup = this.group.addGroup("reduce", "Reduce");
coverGroup
.addProperty("factor", "Factor", EditorType.number)
.change(() => {
void this.particles().refresh();
})
.step(1);
coverGroup.addProperty("value", "Value", EditorType.boolean).change(() => {
void this.particles().refresh();
});
}
}