@tsparticles/editor
Version:
tsParticles Configuration Editor
43 lines (42 loc) • 1.8 kB
JavaScript
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports", "object-gui", "../../../../EditorBase"], factory);
}
})(function (require, exports) {
"use strict";
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;
});