UNPKG

@tsparticles/updater-tilt

Version:

tsParticles particles tilt updater

29 lines (28 loc) 792 B
import { ValueWithRandom, isNull } from "@tsparticles/engine"; import { TiltDirection } from "../../TiltDirection.js"; import { TiltAnimation } from "./TiltAnimation.js"; export class Tilt extends ValueWithRandom { animation; direction; enable; constructor() { super(); this.animation = new TiltAnimation(); this.direction = TiltDirection.clockwise; this.enable = false; this.value = 0; } load(data) { super.load(data); if (isNull(data)) { return; } this.animation.load(data.animation); if (data.direction !== undefined) { this.direction = data.direction; } if (data.enable !== undefined) { this.enable = data.enable; } } }