@tsparticles/editor
Version:
tsParticles Configuration Editor
40 lines (39 loc) • 1.52 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventsOptionsEditor = void 0;
const object_gui_1 = require("object-gui");
const ClickEventsOptionsEditor_1 = require("./ClickEventsOptionsEditor");
const DivsEventsOptionsEditor_1 = require("./DivsEventsOptionsEditor");
const EditorBase_1 = require("../../../../EditorBase");
const HoverEventsOptionsEditor_1 = require("./HoverEventsOptionsEditor");
class EventsOptionsEditor extends EditorBase_1.EditorBase {
constructor(particles) {
super(particles);
}
addToGroup(parent) {
this.group = parent.addGroup("events", "Events");
this.options = this.group.data;
this.addClick();
this.addDivs();
this.addHover();
this.addProperties();
}
addClick() {
const clickEditor = new ClickEventsOptionsEditor_1.ClickEventsOptionsEditor(this.particles);
clickEditor.addToGroup(this.group);
}
addDivs() {
const divsEditor = new DivsEventsOptionsEditor_1.DivsEventsOptionsEditor(this.particles);
divsEditor.addToGroup(this.group);
}
addHover() {
const hoverEditor = new HoverEventsOptionsEditor_1.HoverEventsOptionsEditor(this.particles);
hoverEditor.addToGroup(this.group);
}
addProperties() {
this.group.addProperty("resize", "Resize", object_gui_1.EditorType.boolean).change(() => {
void this.particles().refresh();
});
}
}
exports.EventsOptionsEditor = EventsOptionsEditor;