UNPKG

@tsparticles/updater-orbit

Version:

tsParticles particles orbit updater

38 lines (37 loc) 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Orbit = void 0; const engine_1 = require("@tsparticles/engine"); const OrbitRotation_js_1 = require("./OrbitRotation.js"); class Orbit { constructor() { this.animation = new engine_1.AnimationOptions(); this.enable = false; this.opacity = 1; this.rotation = new OrbitRotation_js_1.OrbitRotation(); this.width = 1; } load(data) { if ((0, engine_1.isNull)(data)) { return; } this.animation.load(data.animation); this.rotation.load(data.rotation); if (data.enable !== undefined) { this.enable = data.enable; } if (data.opacity !== undefined) { this.opacity = (0, engine_1.setRangeValue)(data.opacity); } if (data.width !== undefined) { this.width = (0, engine_1.setRangeValue)(data.width); } if (data.radius !== undefined) { this.radius = (0, engine_1.setRangeValue)(data.radius); } if (data.color !== undefined) { this.color = engine_1.OptionsColor.create(this.color, data.color); } } } exports.Orbit = Orbit;