@tsparticles/engine 4.0.4 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/browser/Core/CanvasManager.js +72 -72
  2. package/browser/Core/Container.js +85 -85
  3. package/browser/Core/Engine.js +11 -11
  4. package/browser/Core/Particle.js +142 -63
  5. package/browser/Core/ParticlesManager.js +138 -138
  6. package/browser/Core/RenderManager.js +110 -110
  7. package/browser/Core/Retina.js +3 -4
  8. package/browser/Core/Utils/EventListeners.js +31 -31
  9. package/browser/Core/Utils/PluginManager.js +26 -26
  10. package/browser/Core/Utils/SpatialHashGrid.js +36 -36
  11. package/browser/Core/Utils/Vectors.js +3 -3
  12. package/browser/Options/Classes/Options.js +13 -13
  13. package/browser/Options/Classes/Particles/ParticlesOptions.js +11 -19
  14. package/browser/Utils/EventDispatcher.js +10 -10
  15. package/browser/exports.js +0 -4
  16. package/cjs/Core/CanvasManager.js +72 -72
  17. package/cjs/Core/Container.js +85 -85
  18. package/cjs/Core/Engine.js +11 -11
  19. package/cjs/Core/Particle.js +142 -63
  20. package/cjs/Core/ParticlesManager.js +138 -138
  21. package/cjs/Core/RenderManager.js +110 -110
  22. package/cjs/Core/Retina.js +3 -4
  23. package/cjs/Core/Utils/EventListeners.js +31 -31
  24. package/cjs/Core/Utils/PluginManager.js +26 -26
  25. package/cjs/Core/Utils/SpatialHashGrid.js +36 -36
  26. package/cjs/Core/Utils/Vectors.js +3 -3
  27. package/cjs/Options/Classes/Options.js +13 -13
  28. package/cjs/Options/Classes/Particles/ParticlesOptions.js +11 -19
  29. package/cjs/Utils/EventDispatcher.js +10 -10
  30. package/cjs/exports.js +0 -4
  31. package/esm/Core/CanvasManager.js +72 -72
  32. package/esm/Core/Container.js +85 -85
  33. package/esm/Core/Engine.js +11 -11
  34. package/esm/Core/Particle.js +142 -63
  35. package/esm/Core/ParticlesManager.js +138 -138
  36. package/esm/Core/RenderManager.js +110 -110
  37. package/esm/Core/Retina.js +3 -4
  38. package/esm/Core/Utils/EventListeners.js +31 -31
  39. package/esm/Core/Utils/PluginManager.js +26 -26
  40. package/esm/Core/Utils/SpatialHashGrid.js +36 -36
  41. package/esm/Core/Utils/Vectors.js +3 -3
  42. package/esm/Options/Classes/Options.js +13 -13
  43. package/esm/Options/Classes/Particles/ParticlesOptions.js +11 -19
  44. package/esm/Utils/EventDispatcher.js +10 -10
  45. package/esm/exports.js +0 -4
  46. package/package.json +1 -1
  47. package/report.html +1 -1
  48. package/tsparticles.engine.js +690 -697
  49. package/tsparticles.engine.min.js +1 -1
  50. package/types/Core/CanvasManager.d.ts +1 -16
  51. package/types/Core/Container.d.ts +1 -18
  52. package/types/Core/Engine.d.ts +1 -3
  53. package/types/Core/Interfaces/IEffectDrawer.d.ts +2 -0
  54. package/types/Core/Interfaces/IParticleCanvasBounds.d.ts +16 -0
  55. package/types/Core/Interfaces/IParticleUpdater.d.ts +1 -0
  56. package/types/Core/Interfaces/IShapeDrawer.d.ts +2 -0
  57. package/types/Core/Particle.d.ts +5 -13
  58. package/types/Core/ParticlesManager.d.ts +1 -28
  59. package/types/Core/RenderManager.d.ts +1 -23
  60. package/types/Core/Retina.d.ts +1 -1
  61. package/types/Core/Utils/EventListeners.d.ts +1 -8
  62. package/types/Core/Utils/PluginManager.d.ts +1 -8
  63. package/types/Core/Utils/SpatialHashGrid.d.ts +1 -12
  64. package/types/Core/Utils/Vectors.d.ts +1 -1
  65. package/types/Options/Classes/Options.d.ts +1 -4
  66. package/types/Options/Classes/Particles/ParticlesOptions.d.ts +1 -7
  67. package/types/Options/Interfaces/Particles/IParticlesOptions.d.ts +0 -4
  68. package/types/Utils/EventDispatcher.d.ts +1 -1
  69. package/types/export-types.d.ts +1 -4
  70. package/types/exports.d.ts +0 -4
  71. package/browser/Options/Classes/Particles/Opacity/Opacity.js +0 -21
  72. package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -20
  73. package/browser/Options/Classes/Particles/Size/Size.js +0 -21
  74. package/browser/Options/Classes/Particles/Size/SizeAnimation.js +0 -20
  75. package/browser/Options/Interfaces/Particles/Size/ISizeAnimation.js +0 -1
  76. package/cjs/Options/Classes/Particles/Opacity/Opacity.js +0 -21
  77. package/cjs/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -20
  78. package/cjs/Options/Classes/Particles/Size/Size.js +0 -21
  79. package/cjs/Options/Classes/Particles/Size/SizeAnimation.js +0 -20
  80. package/cjs/Options/Interfaces/Particles/Opacity/IOpacity.js +0 -1
  81. package/cjs/Options/Interfaces/Particles/Opacity/IOpacityAnimation.js +0 -1
  82. package/cjs/Options/Interfaces/Particles/Size/ISize.js +0 -1
  83. package/cjs/Options/Interfaces/Particles/Size/ISizeAnimation.js +0 -1
  84. package/esm/Options/Classes/Particles/Opacity/Opacity.js +0 -21
  85. package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -20
  86. package/esm/Options/Classes/Particles/Size/Size.js +0 -21
  87. package/esm/Options/Classes/Particles/Size/SizeAnimation.js +0 -20
  88. package/esm/Options/Interfaces/Particles/Opacity/IOpacity.js +0 -1
  89. package/esm/Options/Interfaces/Particles/Opacity/IOpacityAnimation.js +0 -1
  90. package/esm/Options/Interfaces/Particles/Size/ISize.js +0 -1
  91. package/esm/Options/Interfaces/Particles/Size/ISizeAnimation.js +0 -1
  92. package/types/Options/Classes/Particles/Opacity/Opacity.d.ts +0 -10
  93. package/types/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +0 -10
  94. package/types/Options/Classes/Particles/Size/Size.d.ts +0 -10
  95. package/types/Options/Classes/Particles/Size/SizeAnimation.d.ts +0 -10
  96. package/types/Options/Interfaces/Particles/Opacity/IOpacity.d.ts +0 -5
  97. package/types/Options/Interfaces/Particles/Opacity/IOpacityAnimation.d.ts +0 -5
  98. package/types/Options/Interfaces/Particles/Size/ISize.d.ts +0 -5
  99. package/types/Options/Interfaces/Particles/Size/ISizeAnimation.d.ts +0 -5
  100. /package/browser/{Options/Interfaces/Particles/Opacity/IOpacity.js → Core/Interfaces/IParticleCanvasBounds.js} +0 -0
  101. /package/{browser/Options/Interfaces/Particles/Opacity/IOpacityAnimation.js → cjs/Core/Interfaces/IParticleCanvasBounds.js} +0 -0
  102. /package/{browser/Options/Interfaces/Particles/Size/ISize.js → esm/Core/Interfaces/IParticleCanvasBounds.js} +0 -0
@@ -4,26 +4,7 @@ import type { IDelta } from "./Interfaces/IDelta.js";
4
4
  import type { Particle } from "./Particle.js";
5
5
  import type { PluginManager } from "./Utils/PluginManager.js";
6
6
  export declare class RenderManager {
7
- private _canvasClearPlugins;
8
- private readonly _canvasManager;
9
- private _canvasPaintPlugins;
10
- private _clearDrawPlugins;
11
- private _colorPlugins;
12
- private readonly _container;
13
- private _context;
14
- private _contextSettings?;
15
- private _drawParticlePlugins;
16
- private _drawParticlesCleanupPlugins;
17
- private _drawParticlesSetupPlugins;
18
- private _drawPlugins;
19
- private _drawSettingsCleanupPlugins;
20
- private _drawSettingsSetupPlugins;
21
- private readonly _pluginManager;
22
- private _postDrawUpdaters;
23
- private _preDrawUpdaters;
24
- private readonly _reusableColorStyles;
25
- private readonly _reusablePluginColors;
26
- private readonly _reusableTransform;
7
+ #private;
27
8
  constructor(pluginManager: PluginManager, container: Container, canvasManager: CanvasManager);
28
9
  get settings(): CanvasRenderingContext2DSettings | undefined;
29
10
  canvasClear(): void;
@@ -42,7 +23,4 @@ export declare class RenderManager {
42
23
  setContext(context: OffscreenCanvasRenderingContext2D | null): void;
43
24
  setContextSettings(settings: CanvasRenderingContext2DSettings): void;
44
25
  stop(): void;
45
- private readonly _applyPostDrawUpdaters;
46
- private readonly _applyPreDrawUpdaters;
47
- private readonly _getPluginParticleColors;
48
26
  }
@@ -1,7 +1,7 @@
1
1
  import type { Container } from "./Container.js";
2
2
  import type { Particle } from "./Particle.js";
3
3
  export declare class Retina {
4
- private readonly container;
4
+ #private;
5
5
  pixelRatio: number;
6
6
  reduceFactor: number;
7
7
  constructor(container: Container);
@@ -1,14 +1,7 @@
1
1
  import type { Container } from "../Container.js";
2
2
  export declare class EventListeners {
3
- private readonly container;
4
- private readonly _handlers;
5
- private _resizeObserver?;
6
- private _resizeTimeout?;
3
+ #private;
7
4
  constructor(container: Container);
8
5
  addListeners(): void;
9
6
  removeListeners(): void;
10
- private readonly _handleVisibilityChange;
11
- private readonly _handleWindowResize;
12
- private readonly _manageListeners;
13
- private readonly _manageResize;
14
7
  }
@@ -19,6 +19,7 @@ export type AsyncLoadPluginNoEngine = () => Promise<void>;
19
19
  export type SyncLoadPluginNoEngine = () => void;
20
20
  export type LoadPluginFunction = AsyncLoadPluginFunction | SyncLoadPluginFunction | AsyncLoadPluginNoEngine | SyncLoadPluginNoEngine;
21
21
  export declare class PluginManager {
22
+ #private;
22
23
  readonly colorManagers: Map<string, IColorManager>;
23
24
  readonly easingFunctions: Map<EasingTypeAlt | EasingType, EasingFunction>;
24
25
  readonly effectDrawers: Map<Container, Map<string, IEffectDrawer<import("../Particle.js").Particle>>>;
@@ -28,13 +29,6 @@ export declare class PluginManager {
28
29
  readonly presets: Map<string, RecursivePartial<import("../../export-types.js").IOptions>>;
29
30
  readonly shapeDrawers: Map<Container, Map<string, IShapeDrawer<import("../Particle.js").Particle>>>;
30
31
  readonly updaters: Map<Container, IParticleUpdater[]>;
31
- private _allLoadersSet;
32
- private readonly _configs;
33
- private readonly _engine;
34
- private _executedSet;
35
- private _initialized;
36
- private _isRunningLoaders;
37
- private readonly _loadPromises;
38
32
  constructor(engine: Engine);
39
33
  get configs(): Record<string, ISourceOptions>;
40
34
  addColorManager(name: string, manager: IColorManager): void;
@@ -57,5 +51,4 @@ export declare class PluginManager {
57
51
  init(): Promise<void>;
58
52
  loadParticlesOptions(container: Container, options: ParticlesOptions, ...sourceOptions: (RecursivePartial<IParticlesOptions> | undefined)[]): void;
59
53
  register(...loaders: LoadPluginFunction[]): Promise<void>;
60
- private _runLoader;
61
54
  }
@@ -3,13 +3,7 @@ import type { ICoordinates } from "../Interfaces/ICoordinates.js";
3
3
  import type { IDimension } from "../Interfaces/IDimension.js";
4
4
  import type { Particle } from "../Particle.js";
5
5
  export declare class SpatialHashGrid {
6
- private _cellSize;
7
- private readonly _cells;
8
- private readonly _circlePool;
9
- private _circlePoolIdx;
10
- private _pendingCellSize?;
11
- private readonly _rectanglePool;
12
- private _rectanglePoolIdx;
6
+ #private;
13
7
  constructor(cellSize: number);
14
8
  clear(): void;
15
9
  insert(particle: Particle): void;
@@ -17,9 +11,4 @@ export declare class SpatialHashGrid {
17
11
  queryCircle(position: ICoordinates, radius: number, check?: (particle: Particle) => boolean, out?: Particle[]): Particle[];
18
12
  queryRectangle(position: ICoordinates, size: IDimension, check?: (particle: Particle) => boolean, out?: Particle[]): Particle[];
19
13
  setCellSize(cellSize: number): void;
20
- private _acquireCircle;
21
- private _acquireRectangle;
22
- private _cellKeyFromCoords;
23
- private _getRangeBounds;
24
- private _releaseShapes;
25
14
  }
@@ -1,5 +1,6 @@
1
1
  import type { ICoordinates, ICoordinates3d } from "../Interfaces/ICoordinates.js";
2
2
  export declare class Vector3d implements ICoordinates3d {
3
+ #private;
3
4
  x: number;
4
5
  y: number;
5
6
  z: number;
@@ -24,7 +25,6 @@ export declare class Vector3d implements ICoordinates3d {
24
25
  setTo(c: ICoordinates | ICoordinates3d): void;
25
26
  sub(v: ICoordinates | ICoordinates3d): Vector3d;
26
27
  subFrom(v: ICoordinates | ICoordinates3d): void;
27
- private _updateFromAngle;
28
28
  }
29
29
  export declare class Vector extends Vector3d {
30
30
  protected constructor(x?: number, y?: number);
@@ -14,6 +14,7 @@ export interface DefaultThemes {
14
14
  light?: string;
15
15
  }
16
16
  export declare class Options implements IOptions, IOptionLoader<IOptions> {
17
+ #private;
17
18
  [name: string]: unknown;
18
19
  autoPlay: boolean;
19
20
  readonly background: Background;
@@ -36,10 +37,6 @@ export declare class Options implements IOptions, IOptionLoader<IOptions> {
36
37
  smooth: boolean;
37
38
  style: RecursivePartial<CSSStyleDeclaration>;
38
39
  zLayers: number;
39
- private readonly _container;
40
- private readonly _pluginManager;
41
40
  constructor(pluginManager: PluginManager, container: Container);
42
41
  load(data?: ISourceOptions): void;
43
- private readonly _importPalette;
44
- private readonly _importPreset;
45
42
  }
@@ -3,7 +3,6 @@ import { Effect } from "./Effect/Effect.js";
3
3
  import type { IOptionLoader } from "../../Interfaces/IOptionLoader.js";
4
4
  import type { IParticlesOptions } from "../../Interfaces/Particles/IParticlesOptions.js";
5
5
  import { Move } from "./Move/Move.js";
6
- import { Opacity } from "./Opacity/Opacity.js";
7
6
  import { Paint } from "./Paint.js";
8
7
  import { ParticlesBounce } from "./Bounce/ParticlesBounce.js";
9
8
  import type { ParticlesGroups } from "../../../Types/ParticlesGroups.js";
@@ -12,25 +11,20 @@ import type { PluginManager } from "../../../Core/Utils/PluginManager.js";
12
11
  import type { RecursivePartial } from "../../../Types/RecursivePartial.js";
13
12
  import { Shape } from "./Shape/Shape.js";
14
13
  import type { SingleOrMultiple } from "../../../Types/SingleOrMultiple.js";
15
- import { Size } from "./Size/Size.js";
16
14
  import { ZIndex } from "./ZIndex/ZIndex.js";
17
15
  export declare class ParticlesOptions implements IParticlesOptions, IOptionLoader<IParticlesOptions> {
16
+ #private;
18
17
  [name: string]: unknown;
19
18
  readonly bounce: ParticlesBounce;
20
19
  readonly effect: Effect;
21
20
  readonly groups: ParticlesGroups;
22
21
  readonly move: Move;
23
22
  readonly number: ParticlesNumber;
24
- readonly opacity: Opacity;
25
23
  paint: SingleOrMultiple<Paint>;
26
24
  palette?: string;
27
25
  reduceDuplicates: boolean;
28
26
  readonly shape: Shape;
29
- readonly size: Size;
30
27
  readonly zIndex: ZIndex;
31
- private readonly _container;
32
- private readonly _pluginManager;
33
28
  constructor(pluginManager: PluginManager, container?: Container);
34
29
  load(data?: RecursivePartial<IParticlesOptions>): void;
35
- private readonly _importPalette;
36
30
  }
@@ -1,11 +1,9 @@
1
1
  import type { IEffect } from "./Effect/IEffect.js";
2
2
  import type { IMove } from "./Move/IMove.js";
3
- import type { IOpacity } from "./Opacity/IOpacity.js";
4
3
  import type { IPaint } from "./IPaint.js";
5
4
  import type { IParticlesBounce } from "./Bounce/IParticlesBounce.js";
6
5
  import type { IParticlesNumber } from "./Number/IParticlesNumber.js";
7
6
  import type { IShape } from "./Shape/IShape.js";
8
- import type { ISize } from "./Size/ISize.js";
9
7
  import type { IZIndex } from "./ZIndex/IZIndex.js";
10
8
  import type { ParticlesGroups } from "../../../Types/ParticlesGroups.js";
11
9
  import type { SingleOrMultiple } from "../../../Types/SingleOrMultiple.js";
@@ -16,11 +14,9 @@ export interface IParticlesOptions {
16
14
  groups: ParticlesGroups;
17
15
  move: IMove;
18
16
  number: IParticlesNumber;
19
- opacity: IOpacity;
20
17
  paint: SingleOrMultiple<IPaint>;
21
18
  palette?: string;
22
19
  reduceDuplicates: boolean;
23
20
  shape: IShape;
24
- size: ISize;
25
21
  zIndex: IZIndex;
26
22
  }
@@ -1,7 +1,7 @@
1
1
  import type { CustomEventArgs } from "../Types/CustomEventArgs.js";
2
2
  import type { CustomEventListener } from "../Types/CustomEventListener.js";
3
3
  export declare class EventDispatcher {
4
- private _listeners;
4
+ #private;
5
5
  constructor();
6
6
  addEventListener(type: string, listener: CustomEventListener): void;
7
7
  dispatchEvent(type: string, args?: CustomEventArgs): void;
@@ -12,6 +12,7 @@ export type * from "./Core/Interfaces/IDrawParticleParams.js";
12
12
  export type * from "./Core/Interfaces/IEffectDrawer.js";
13
13
  export type * from "./Core/Interfaces/ILoadParams.js";
14
14
  export type * from "./Core/Interfaces/IPalette.js";
15
+ export type * from "./Core/Interfaces/IParticleCanvasBounds.js";
15
16
  export type * from "./Core/Interfaces/IParticleColorStyle.js";
16
17
  export type * from "./Core/Interfaces/IParticleHslAnimation.js";
17
18
  export type * from "./Core/Interfaces/IParticleLife.js";
@@ -55,11 +56,7 @@ export type * from "./Options/Interfaces/Particles/Move/ISpin.js";
55
56
  export type * from "./Options/Interfaces/Particles/Number/IParticlesDensity.js";
56
57
  export type * from "./Options/Interfaces/Particles/Number/IParticlesNumber.js";
57
58
  export type * from "./Options/Interfaces/Particles/Number/IParticlesNumberLimit.js";
58
- export type * from "./Options/Interfaces/Particles/Opacity/IOpacity.js";
59
- export type * from "./Options/Interfaces/Particles/Opacity/IOpacityAnimation.js";
60
59
  export type * from "./Options/Interfaces/Particles/Shape/IShape.js";
61
- export type * from "./Options/Interfaces/Particles/Size/ISize.js";
62
- export type * from "./Options/Interfaces/Particles/Size/ISizeAnimation.js";
63
60
  export type * from "./Options/Interfaces/Particles/ZIndex/IZIndex.js";
64
61
  export type * from "./Types/CustomEventArgs.js";
65
62
  export type * from "./Types/CustomEventListener.js";
@@ -40,11 +40,7 @@ export * from "./Options/Classes/Particles/Move/Spin.js";
40
40
  export * from "./Options/Classes/Particles/Number/ParticlesNumber.js";
41
41
  export * from "./Options/Classes/Particles/Number/ParticlesNumberLimit.js";
42
42
  export * from "./Options/Classes/Particles/Number/ParticlesDensity.js";
43
- export * from "./Options/Classes/Particles/Opacity/Opacity.js";
44
- export * from "./Options/Classes/Particles/Opacity/OpacityAnimation.js";
45
43
  export * from "./Options/Classes/Particles/Shape/Shape.js";
46
- export * from "./Options/Classes/Particles/Size/Size.js";
47
- export * from "./Options/Classes/Particles/Size/SizeAnimation.js";
48
44
  export * from "./Options/Classes/Particles/ZIndex/ZIndex.js";
49
45
  export * from "./Options/Classes/ResizeEvent.js";
50
46
  export * from "./Options/Classes/ValueWithRandom.js";
@@ -1,21 +0,0 @@
1
- import { OpacityAnimation } from "./OpacityAnimation.js";
2
- import { RangedAnimationValueWithRandom } from "../../ValueWithRandom.js";
3
- import { isNull } from "../../../../Utils/TypeUtils.js";
4
- export class Opacity extends RangedAnimationValueWithRandom {
5
- animation;
6
- constructor() {
7
- super();
8
- this.animation = new OpacityAnimation();
9
- this.value = 1;
10
- }
11
- load(data) {
12
- if (isNull(data)) {
13
- return;
14
- }
15
- super.load(data);
16
- const animation = data.animation;
17
- if (animation !== undefined) {
18
- this.animation.load(animation);
19
- }
20
- }
21
- }
@@ -1,20 +0,0 @@
1
- import { DestroyType } from "../../../../Enums/Types/DestroyType.js";
2
- import { RangedAnimationOptions } from "../../AnimationOptions.js";
3
- import { isNull } from "../../../../Utils/TypeUtils.js";
4
- export class OpacityAnimation extends RangedAnimationOptions {
5
- destroy;
6
- constructor() {
7
- super();
8
- this.destroy = DestroyType.none;
9
- this.speed = 2;
10
- }
11
- load(data) {
12
- super.load(data);
13
- if (isNull(data)) {
14
- return;
15
- }
16
- if (data.destroy !== undefined) {
17
- this.destroy = data.destroy;
18
- }
19
- }
20
- }
@@ -1,21 +0,0 @@
1
- import { RangedAnimationValueWithRandom } from "../../ValueWithRandom.js";
2
- import { SizeAnimation } from "./SizeAnimation.js";
3
- import { isNull } from "../../../../Utils/TypeUtils.js";
4
- export class Size extends RangedAnimationValueWithRandom {
5
- animation;
6
- constructor() {
7
- super();
8
- this.animation = new SizeAnimation();
9
- this.value = 3;
10
- }
11
- load(data) {
12
- super.load(data);
13
- if (isNull(data)) {
14
- return;
15
- }
16
- const animation = data.animation;
17
- if (animation !== undefined) {
18
- this.animation.load(animation);
19
- }
20
- }
21
- }
@@ -1,20 +0,0 @@
1
- import { DestroyType } from "../../../../Enums/Types/DestroyType.js";
2
- import { RangedAnimationOptions } from "../../AnimationOptions.js";
3
- import { isNull } from "../../../../Utils/TypeUtils.js";
4
- export class SizeAnimation extends RangedAnimationOptions {
5
- destroy;
6
- constructor() {
7
- super();
8
- this.destroy = DestroyType.none;
9
- this.speed = 5;
10
- }
11
- load(data) {
12
- super.load(data);
13
- if (isNull(data)) {
14
- return;
15
- }
16
- if (data.destroy !== undefined) {
17
- this.destroy = data.destroy;
18
- }
19
- }
20
- }
@@ -1,21 +0,0 @@
1
- import { OpacityAnimation } from "./OpacityAnimation.js";
2
- import { RangedAnimationValueWithRandom } from "../../ValueWithRandom.js";
3
- import { isNull } from "../../../../Utils/TypeUtils.js";
4
- export class Opacity extends RangedAnimationValueWithRandom {
5
- animation;
6
- constructor() {
7
- super();
8
- this.animation = new OpacityAnimation();
9
- this.value = 1;
10
- }
11
- load(data) {
12
- if (isNull(data)) {
13
- return;
14
- }
15
- super.load(data);
16
- const animation = data.animation;
17
- if (animation !== undefined) {
18
- this.animation.load(animation);
19
- }
20
- }
21
- }
@@ -1,20 +0,0 @@
1
- import { DestroyType } from "../../../../Enums/Types/DestroyType.js";
2
- import { RangedAnimationOptions } from "../../AnimationOptions.js";
3
- import { isNull } from "../../../../Utils/TypeUtils.js";
4
- export class OpacityAnimation extends RangedAnimationOptions {
5
- destroy;
6
- constructor() {
7
- super();
8
- this.destroy = DestroyType.none;
9
- this.speed = 2;
10
- }
11
- load(data) {
12
- super.load(data);
13
- if (isNull(data)) {
14
- return;
15
- }
16
- if (data.destroy !== undefined) {
17
- this.destroy = data.destroy;
18
- }
19
- }
20
- }
@@ -1,21 +0,0 @@
1
- import { RangedAnimationValueWithRandom } from "../../ValueWithRandom.js";
2
- import { SizeAnimation } from "./SizeAnimation.js";
3
- import { isNull } from "../../../../Utils/TypeUtils.js";
4
- export class Size extends RangedAnimationValueWithRandom {
5
- animation;
6
- constructor() {
7
- super();
8
- this.animation = new SizeAnimation();
9
- this.value = 3;
10
- }
11
- load(data) {
12
- super.load(data);
13
- if (isNull(data)) {
14
- return;
15
- }
16
- const animation = data.animation;
17
- if (animation !== undefined) {
18
- this.animation.load(animation);
19
- }
20
- }
21
- }
@@ -1,20 +0,0 @@
1
- import { DestroyType } from "../../../../Enums/Types/DestroyType.js";
2
- import { RangedAnimationOptions } from "../../AnimationOptions.js";
3
- import { isNull } from "../../../../Utils/TypeUtils.js";
4
- export class SizeAnimation extends RangedAnimationOptions {
5
- destroy;
6
- constructor() {
7
- super();
8
- this.destroy = DestroyType.none;
9
- this.speed = 5;
10
- }
11
- load(data) {
12
- super.load(data);
13
- if (isNull(data)) {
14
- return;
15
- }
16
- if (data.destroy !== undefined) {
17
- this.destroy = data.destroy;
18
- }
19
- }
20
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
1
- import { OpacityAnimation } from "./OpacityAnimation.js";
2
- import { RangedAnimationValueWithRandom } from "../../ValueWithRandom.js";
3
- import { isNull } from "../../../../Utils/TypeUtils.js";
4
- export class Opacity extends RangedAnimationValueWithRandom {
5
- animation;
6
- constructor() {
7
- super();
8
- this.animation = new OpacityAnimation();
9
- this.value = 1;
10
- }
11
- load(data) {
12
- if (isNull(data)) {
13
- return;
14
- }
15
- super.load(data);
16
- const animation = data.animation;
17
- if (animation !== undefined) {
18
- this.animation.load(animation);
19
- }
20
- }
21
- }
@@ -1,20 +0,0 @@
1
- import { DestroyType } from "../../../../Enums/Types/DestroyType.js";
2
- import { RangedAnimationOptions } from "../../AnimationOptions.js";
3
- import { isNull } from "../../../../Utils/TypeUtils.js";
4
- export class OpacityAnimation extends RangedAnimationOptions {
5
- destroy;
6
- constructor() {
7
- super();
8
- this.destroy = DestroyType.none;
9
- this.speed = 2;
10
- }
11
- load(data) {
12
- super.load(data);
13
- if (isNull(data)) {
14
- return;
15
- }
16
- if (data.destroy !== undefined) {
17
- this.destroy = data.destroy;
18
- }
19
- }
20
- }
@@ -1,21 +0,0 @@
1
- import { RangedAnimationValueWithRandom } from "../../ValueWithRandom.js";
2
- import { SizeAnimation } from "./SizeAnimation.js";
3
- import { isNull } from "../../../../Utils/TypeUtils.js";
4
- export class Size extends RangedAnimationValueWithRandom {
5
- animation;
6
- constructor() {
7
- super();
8
- this.animation = new SizeAnimation();
9
- this.value = 3;
10
- }
11
- load(data) {
12
- super.load(data);
13
- if (isNull(data)) {
14
- return;
15
- }
16
- const animation = data.animation;
17
- if (animation !== undefined) {
18
- this.animation.load(animation);
19
- }
20
- }
21
- }
@@ -1,20 +0,0 @@
1
- import { DestroyType } from "../../../../Enums/Types/DestroyType.js";
2
- import { RangedAnimationOptions } from "../../AnimationOptions.js";
3
- import { isNull } from "../../../../Utils/TypeUtils.js";
4
- export class SizeAnimation extends RangedAnimationOptions {
5
- destroy;
6
- constructor() {
7
- super();
8
- this.destroy = DestroyType.none;
9
- this.speed = 5;
10
- }
11
- load(data) {
12
- super.load(data);
13
- if (isNull(data)) {
14
- return;
15
- }
16
- if (data.destroy !== undefined) {
17
- this.destroy = data.destroy;
18
- }
19
- }
20
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- import type { IOpacity } from "../../../Interfaces/Particles/Opacity/IOpacity.js";
2
- import type { IOptionLoader } from "../../../Interfaces/IOptionLoader.js";
3
- import { OpacityAnimation } from "./OpacityAnimation.js";
4
- import { RangedAnimationValueWithRandom } from "../../ValueWithRandom.js";
5
- import type { RecursivePartial } from "../../../../Types/RecursivePartial.js";
6
- export declare class Opacity extends RangedAnimationValueWithRandom implements IOpacity, IOptionLoader<IOpacity> {
7
- readonly animation: OpacityAnimation;
8
- constructor();
9
- load(data?: RecursivePartial<IOpacity>): void;
10
- }
@@ -1,10 +0,0 @@
1
- import { DestroyType } from "../../../../Enums/Types/DestroyType.js";
2
- import type { IOpacityAnimation } from "../../../Interfaces/Particles/Opacity/IOpacityAnimation.js";
3
- import type { IOptionLoader } from "../../../Interfaces/IOptionLoader.js";
4
- import { RangedAnimationOptions } from "../../AnimationOptions.js";
5
- import type { RecursivePartial } from "../../../../Types/RecursivePartial.js";
6
- export declare class OpacityAnimation extends RangedAnimationOptions implements IOpacityAnimation, IOptionLoader<IOpacityAnimation> {
7
- destroy: DestroyType | keyof typeof DestroyType;
8
- constructor();
9
- load(data?: RecursivePartial<IOpacityAnimation>): void;
10
- }
@@ -1,10 +0,0 @@
1
- import type { IOptionLoader } from "../../../Interfaces/IOptionLoader.js";
2
- import type { ISize } from "../../../Interfaces/Particles/Size/ISize.js";
3
- import { RangedAnimationValueWithRandom } from "../../ValueWithRandom.js";
4
- import type { RecursivePartial } from "../../../../Types/RecursivePartial.js";
5
- import { SizeAnimation } from "./SizeAnimation.js";
6
- export declare class Size extends RangedAnimationValueWithRandom implements ISize, IOptionLoader<ISize> {
7
- readonly animation: SizeAnimation;
8
- constructor();
9
- load(data?: RecursivePartial<ISize>): void;
10
- }
@@ -1,10 +0,0 @@
1
- import { DestroyType } from "../../../../Enums/Types/DestroyType.js";
2
- import type { IOptionLoader } from "../../../Interfaces/IOptionLoader.js";
3
- import type { ISizeAnimation } from "../../../Interfaces/Particles/Size/ISizeAnimation.js";
4
- import { RangedAnimationOptions } from "../../AnimationOptions.js";
5
- import type { RecursivePartial } from "../../../../Types/RecursivePartial.js";
6
- export declare class SizeAnimation extends RangedAnimationOptions implements ISizeAnimation, IOptionLoader<ISizeAnimation> {
7
- destroy: DestroyType | keyof typeof DestroyType;
8
- constructor();
9
- load(data?: RecursivePartial<ISizeAnimation>): void;
10
- }
@@ -1,5 +0,0 @@
1
- import type { IOpacityAnimation } from "./IOpacityAnimation.js";
2
- import type { IValueWithRandom } from "../../IValueWithRandom.js";
3
- export interface IOpacity extends IValueWithRandom {
4
- animation: IOpacityAnimation;
5
- }
@@ -1,5 +0,0 @@
1
- import type { DestroyType } from "../../../../Enums/Types/DestroyType.js";
2
- import type { IRangedAnimation } from "../../IAnimation.js";
3
- export interface IOpacityAnimation extends IRangedAnimation {
4
- destroy: DestroyType | keyof typeof DestroyType;
5
- }
@@ -1,5 +0,0 @@
1
- import type { ISizeAnimation } from "./ISizeAnimation.js";
2
- import type { IValueWithRandom } from "../../IValueWithRandom.js";
3
- export interface ISize extends IValueWithRandom {
4
- animation: ISizeAnimation;
5
- }
@@ -1,5 +0,0 @@
1
- import type { DestroyType } from "../../../../Enums/Types/DestroyType.js";
2
- import type { IRangedAnimation } from "../../IAnimation.js";
3
- export interface ISizeAnimation extends IRangedAnimation {
4
- destroy: DestroyType | keyof typeof DestroyType;
5
- }