@tsparticles/editor
Version:
tsParticles Configuration Editor
56 lines (55 loc) • 2.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LifeOptionsEditor = void 0;
const object_gui_1 = require("object-gui");
const EditorBase_1 = require("../../../../EditorBase");
class LifeOptionsEditor extends EditorBase_1.EditorBase {
constructor(particles) {
super(particles);
}
addToGroup(parent, options) {
this.group = parent.addGroup("life", "Life", true, options);
this.options = this.group.data;
this.addDelay();
this.addDuration();
this.addProperties();
}
addDelay() {
const group = this.group.addGroup("delay", "Delay");
const randomGroup = group.addGroup("random", "Random");
randomGroup.addProperty("enable", "Enable", object_gui_1.EditorType.boolean).change(() => {
void this.particles().refresh();
});
randomGroup.addProperty("minimumValue", "MinimumValue", object_gui_1.EditorType.number).change(() => {
void this.particles().refresh();
});
group.addProperty("sync", "Sync", object_gui_1.EditorType.boolean).change(() => {
void this.particles().refresh();
});
group.addProperty("value", "Value", object_gui_1.EditorType.number).change(() => {
void this.particles().refresh();
});
}
addDuration() {
const group = this.group.addGroup("duration", "Duration");
const randomGroup = group.addGroup("random", "Random");
randomGroup.addProperty("enable", "Enable", object_gui_1.EditorType.boolean).change(() => {
void this.particles().refresh();
});
randomGroup.addProperty("minimumValue", "MinimumValue", object_gui_1.EditorType.number).change(() => {
void this.particles().refresh();
});
group.addProperty("sync", "Sync", object_gui_1.EditorType.boolean).change(() => {
void this.particles().refresh();
});
group.addProperty("value", "Value", object_gui_1.EditorType.number).change(() => {
void this.particles().refresh();
});
}
addProperties() {
this.group.addProperty("count", "Count", object_gui_1.EditorType.number).change(() => {
void this.particles().refresh();
});
}
}
exports.LifeOptionsEditor = LifeOptionsEditor;