@tsparticles/editor
Version:
tsParticles Configuration Editor
21 lines (20 loc) • 665 B
JavaScript
import { EditorType } from "object-gui";
import { EditorBase } from "../../../../EditorBase";
export class ShapeOptionsEditor extends EditorBase {
constructor(particles) {
super(particles);
}
addToGroup(parent) {
this.group = parent.addGroup("shape", "Shape");
this.options = this.group.data;
this.addProperties();
}
addProperties() {
const selectType = this.group.addProperty("type", "Type", EditorType.select).change(() => {
void this.particles().refresh();
});
for (const key of this.particles().shapeDrawers.keys()) {
selectType.addItem(key);
}
}
}