@tsparticles/editor
Version:
tsParticles Configuration Editor
33 lines (32 loc) • 1.28 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BounceOptionsEditor = void 0;
const object_gui_1 = require("object-gui");
const EditorBase_1 = require("../../../../EditorBase");
class BounceOptionsEditor extends EditorBase_1.EditorBase {
constructor(particles) {
super(particles);
}
addToGroup(parent) {
this.group = parent.addGroup("bounce", "Bounce");
this.options = this.group.data;
this.addFactors();
}
addFactor(name, title) {
const group = this.group.addGroup(name, title), randomGroup = group.addGroup("random", "Random");
randomGroup.addProperty("enable", "Enable", object_gui_1.EditorType.boolean).change(() => {
void this.particles().refresh();
});
randomGroup.addProperty("minimumValue", "Minimum Value", object_gui_1.EditorType.number).change(() => {
void this.particles().refresh();
});
group.addProperty("value", "Value", object_gui_1.EditorType.number).change(() => {
void this.particles().refresh();
});
}
addFactors() {
this.addFactor("horizontal", "Horizontal");
this.addFactor("vertical", "Vertical");
}
}
exports.BounceOptionsEditor = BounceOptionsEditor;