melonjs 19.8.0 → 19.9.1

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 (111) hide show
  1. package/README.md +3 -0
  2. package/build/application/application.d.ts.map +1 -1
  3. package/build/application/resize.d.ts.map +1 -1
  4. package/build/audio/audio.d.ts +1 -1
  5. package/build/audio/audio.d.ts.map +1 -1
  6. package/build/audio/backend.d.ts +21 -2
  7. package/build/audio/backend.d.ts.map +1 -1
  8. package/build/audio/playback.d.ts +8 -28
  9. package/build/audio/playback.d.ts.map +1 -1
  10. package/build/camera/camera2d.d.ts.map +1 -1
  11. package/build/geometries/path2d.d.ts +188 -75
  12. package/build/geometries/path2d.d.ts.map +1 -1
  13. package/build/geometries/rectangle.d.ts.map +1 -1
  14. package/build/index.d.ts +5 -1
  15. package/build/index.d.ts.map +1 -1
  16. package/build/index.js +3367 -634
  17. package/build/index.js.map +4 -4
  18. package/build/loader/cache.d.ts +1 -0
  19. package/build/loader/cache.d.ts.map +1 -1
  20. package/build/loader/loader.d.ts +61 -3
  21. package/build/loader/loader.d.ts.map +1 -1
  22. package/build/loader/parsers/fetchdata.d.ts +14 -0
  23. package/build/loader/parsers/fetchdata.d.ts.map +1 -1
  24. package/build/loader/parsers/shader.d.ts +47 -0
  25. package/build/loader/parsers/shader.d.ts.map +1 -0
  26. package/build/loader/parsers/video.d.ts.map +1 -1
  27. package/build/math/color.d.ts.map +1 -1
  28. package/build/math/matrix2d.d.ts.map +1 -1
  29. package/build/math/noise.d.ts +141 -0
  30. package/build/math/noise.d.ts.map +1 -0
  31. package/build/math/observableVector2d.d.ts +1 -1
  32. package/build/math/observableVector2d.d.ts.map +1 -1
  33. package/build/math/observableVector3d.d.ts +1 -1
  34. package/build/math/observableVector3d.d.ts.map +1 -1
  35. package/build/math/vector2d.d.ts +1 -1
  36. package/build/math/vector2d.d.ts.map +1 -1
  37. package/build/math/vector3d.d.ts +1 -1
  38. package/build/math/vector3d.d.ts.map +1 -1
  39. package/build/particles/particle.d.ts.map +1 -1
  40. package/build/particles/settings.d.ts +3 -1
  41. package/build/particles/settings.d.ts.map +1 -1
  42. package/build/physics/adapter.d.ts +4 -3
  43. package/build/physics/adapter.d.ts.map +1 -1
  44. package/build/renderable/anchorPoint.d.ts +80 -0
  45. package/build/renderable/anchorPoint.d.ts.map +1 -0
  46. package/build/renderable/collectable.d.ts +7 -1
  47. package/build/renderable/collectable.d.ts.map +1 -1
  48. package/build/renderable/container.d.ts.map +1 -1
  49. package/build/renderable/entity/entity.d.ts +5 -2
  50. package/build/renderable/entity/entity.d.ts.map +1 -1
  51. package/build/renderable/frameAnimation.d.ts.map +1 -1
  52. package/build/renderable/imagelayer.d.ts +5 -2
  53. package/build/renderable/imagelayer.d.ts.map +1 -1
  54. package/build/renderable/mesh.d.ts +26 -2
  55. package/build/renderable/mesh.d.ts.map +1 -1
  56. package/build/renderable/nineslicesprite.d.ts +5 -7
  57. package/build/renderable/nineslicesprite.d.ts.map +1 -1
  58. package/build/renderable/renderable.d.ts +6 -1
  59. package/build/renderable/renderable.d.ts.map +1 -1
  60. package/build/renderable/sprite.d.ts +13 -7
  61. package/build/renderable/sprite.d.ts.map +1 -1
  62. package/build/renderable/sprite3d.d.ts +41 -5
  63. package/build/renderable/sprite3d.d.ts.map +1 -1
  64. package/build/renderable/text/bitmaptext.d.ts +24 -12
  65. package/build/renderable/text/bitmaptext.d.ts.map +1 -1
  66. package/build/renderable/text/bitmaptextdata.d.ts +24 -1
  67. package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
  68. package/build/renderable/text/text.d.ts +50 -12
  69. package/build/renderable/text/text.d.ts.map +1 -1
  70. package/build/state/stage.d.ts.map +1 -1
  71. package/build/system/event.d.ts +18 -2
  72. package/build/system/event.d.ts.map +1 -1
  73. package/build/video/canvas/canvas_renderer.d.ts +4 -0
  74. package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
  75. package/build/video/renderer.d.ts +41 -1
  76. package/build/video/renderer.d.ts.map +1 -1
  77. package/build/video/rendertarget/render_target_pool.d.ts +17 -6
  78. package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
  79. package/build/video/texture/atlas.d.ts +2 -1
  80. package/build/video/texture/atlas.d.ts.map +1 -1
  81. package/build/video/texture/cache.d.ts +55 -6
  82. package/build/video/texture/cache.d.ts.map +1 -1
  83. package/build/video/texture/frametexture.d.ts +73 -0
  84. package/build/video/texture/frametexture.d.ts.map +1 -0
  85. package/build/video/texture/noise_texture2d.d.ts +176 -0
  86. package/build/video/texture/noise_texture2d.d.ts.map +1 -0
  87. package/build/video/texture/parser/aseprite.d.ts.map +1 -1
  88. package/build/video/texture/texture2d.d.ts +83 -0
  89. package/build/video/texture/texture2d.d.ts.map +1 -0
  90. package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
  91. package/build/video/webgl/batchers/lit_quad_batcher.d.ts +30 -4
  92. package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
  93. package/build/video/webgl/batchers/material_batcher.d.ts +39 -3
  94. package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
  95. package/build/video/webgl/batchers/mesh_batcher.d.ts +1 -1
  96. package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
  97. package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -1
  98. package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
  99. package/build/video/webgl/buffer/index.d.ts +13 -0
  100. package/build/video/webgl/buffer/index.d.ts.map +1 -1
  101. package/build/video/webgl/effects/hologram.d.ts +0 -5
  102. package/build/video/webgl/effects/hologram.d.ts.map +1 -1
  103. package/build/video/webgl/effects/shine.d.ts +0 -5
  104. package/build/video/webgl/effects/shine.d.ts.map +1 -1
  105. package/build/video/webgl/glshader.d.ts +29 -0
  106. package/build/video/webgl/glshader.d.ts.map +1 -1
  107. package/build/video/webgl/shadereffect.d.ts +183 -0
  108. package/build/video/webgl/shadereffect.d.ts.map +1 -1
  109. package/build/video/webgl/webgl_renderer.d.ts +41 -1
  110. package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
  111. package/package.json +7 -7
package/README.md CHANGED
@@ -53,6 +53,7 @@ Graphics
53
53
  - Built-in effects such as tinting, masking, and CSS-style blend modes (normal, additive, multiply, screen, darken, lighten)
54
54
  - Standard spritesheet, single and multiple Packed Textures support
55
55
  - Compressed texture support (DDS, KTX, KTX2, PVR, PKM) with automatic format detection and fallback
56
+ - Procedural noise textures: `Noise` (simplex/perlin/value/cellular, fBm / ridged / ping-pong fractal, domain warp; renderer-free and CPU-samplable for heightmaps, terrain, and spawn jitter) and `NoiseTexture2d` — bake a noise field into a sprite image, a `Gradient` color ramp, or a live-animated tangent-space normal map for lit water and surfaces; unified under a new `Texture2d` base alongside `TextureAtlas`
56
57
  - 3D mesh rendering with OBJ/MTL model loading, multi-material support, hardware depth testing, and perspective projection via `Camera3d` — ~30% faster mesh rendering with near-zero per-frame allocation (a re-drawn static mesh produces no GC garbage)
57
58
  - Lighting, in 2D and 3D:
58
59
  - **2D** — `Light2d` as a first-class `Renderable` (multiple dynamic lights, radial-gradient falloff, illumination-only mode, procedural rendering via `drawLight`), plus optional per-pixel normal-map shading on sprites for 3D-looking dynamic lights
@@ -180,6 +181,8 @@ Examples
180
181
  * [Hello World](https://melonjs.github.io/melonJS/examples/#/hello-world) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/helloWorld))
181
182
  * [Whac-A-Mole](https://melonjs.github.io/melonJS/examples/#/whac-a-mole) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/whac-a-mole))
182
183
  * [Compressed Textures](https://melonjs.github.io/melonJS/examples/#/compressed-textures) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/compressedTextures))
184
+ * [Aquarium](https://melonjs.github.io/melonJS/examples/#/aquarium) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/aquarium)) — screen-space water refraction with `renderer.toFrameTexture()`: fish swim across a seabed, then a water surface captures the live frame on the GPU and re-samples it through a scrolling `NoiseTexture2d` flow map (the Godot `hint_screen_texture` / Unity `_CameraOpaqueTexture` pattern)
185
+ * [Heat Haze](https://melonjs.github.io/melonJS/examples/#/heat-haze) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/heatHaze)) — `renderer.toFrameTexture()` over a lit scene: normal-mapped tiles under a moving `Light2d`, distorted by a rising heat-haze that captures and ripples the lit frame
183
186
  * [3D Mesh](https://melonjs.github.io/melonJS/examples/#/mesh-3d) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/mesh3d))
184
187
  * [3D Mesh Material](https://melonjs.github.io/melonJS/examples/#/mesh-3d-material) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/mesh3dMaterial))
185
188
  * [AfterBurner Clone](https://melonjs.github.io/melonJS/examples/#/after-burner) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/afterBurner)) — `Camera3d` + 3D Mesh arcade shooter
@@ -1 +1 @@
1
- {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../src/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAGpD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AA8BxC,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AAOnD,OAAO,KAAK,EACX,mBAAmB,EACnB,2BAA2B,EAC3B,MAAM,eAAe,CAAC;AAgEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAC/B;;OAEG;IACH,aAAa,EAAG,WAAW,CAAC;IAE5B;;OAEG;IACH,QAAQ,EAAG,QAAQ,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAG,QAAQ,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAG,KAAK,CAAC;IAEd;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;;;;OAK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AG,OAAO,EAE1C;IAED;;;;;;OAMG;IACH,aAAa,IAAI,IAAI;IAErB;;;;OAIG;IACH,eAAe,IAAI,IAAI;IAevB;;;OAGG;IACH,gBAAgB,IAAI,WAAW;IAI/B;;;;;;OAMG;IACH,YAAY,IAAI,OAAO;IAIvB;;;;;;;;;;;;;;;;;OAiBG;IACH,iBAAiB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAgB1C;;;OAGG;IACH,cAAc,IAAI,IAAI;IActB;;;;;OAKG;IACH,IAAI,MAAM,IAAI,iBAAiB,CAE9B;IAED;;;;;;;OAOG;IACH,MAAM,IAAI,IAAI;IAId;;;;;;;;OAQG;IACH,OAAO,CAAC,YAAY,GAAE,OAAc,GAAG,IAAI;IAiD3C;;OAEG;IACH,OAAO,IAAI,IAAI;IAIf;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,GAAE,OAAe,GAAG,IAAI;IAInC;;;OAGG;IACH,MAAM,CAAC,KAAK,GAAE,OAAe,GAAG,IAAI;IAIpC;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D,cAAc;IACd,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKzB,cAAc;IACd,OAAO,IAAI,IAAI;IASf,cAAc;IACd,QAAQ,IAAI,IAAI;IAShB;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IA+C1B;;OAEG;IACH,IAAI,IAAI,IAAI;CAqBZ;AAED;;;;;GAKG;AACH,eAAO,IAAI,IAAI,EAAE,WAAW,CAAC;AAE7B;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,QAE9C"}
1
+ {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../src/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CA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AI,CAAC;IAI/D,cAAc;IACd,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKzB,cAAc;IACd,OAAO,IAAI,IAAI;IASf,cAAc;IACd,QAAQ,IAAI,IAAI;IAShB;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IA+C1B;;OAEG;IACH,IAAI,IAAI,IAAI;CAqBZ;AAED;;;;;GAKG;AACH,eAAO,IAAI,IAAI,EAAE,WAAW,CAAC;AAE7B;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,QAE9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"resize.d.ts","sourceRoot":"","sources":["../../src/application/resize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAkChD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CA4EhD"}
1
+ {"version":3,"file":"resize.d.ts","sourceRoot":"","sources":["../../src/application/resize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAkChD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAyGhD"}
@@ -14,7 +14,7 @@
14
14
  * This file owns the remaining lifecycle / track / mix / unload
15
15
  * helpers, plus the barrel re-exports that compose the namespace.
16
16
  */
17
- export { getAudioContext, getMasterGain, stopOnAudioError, } from "./backend.ts";
17
+ export { getAudioContext, getMasterGain, setStopOnAudioError, stopOnAudioError, } from "./backend.ts";
18
18
  export { fade, load, orientation, panner, pause, play, position, rate, resume, seek, stereo, stop, } from "./playback.ts";
19
19
  export { noise, tone } from "./procedural.ts";
20
20
  export type { LoadSettings, NoiseFilter, NoiseOptions, PannerAttributes, SoundAsset, ToneOptions, } from "./types.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../src/audio/audio.ts"],"names":[],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 +15,26 @@ import { Howl } from "howler";
15
15
  *
16
16
  * When `true`, melonJS throws an exception and aborts loading.
17
17
  * When `false`, melonJS disables sound and logs a warning to the console.
18
+ *
19
+ * Read-only through the `me.audio` namespace (module namespace properties
20
+ * can't be assigned) — change it with {@link setStopOnAudioError}.
18
21
  * @default true
22
+ * @see setStopOnAudioError
19
23
  */
20
24
  export declare let stopOnAudioError: boolean;
25
+ /**
26
+ * Set the {@link stopOnAudioError} flag — whether an audio clip that still
27
+ * fails after its retries throws (aborting loading) or just disables sound
28
+ * with a console warning. This setter is the supported way to change the
29
+ * flag: assigning `me.audio.stopOnAudioError = false` directly throws a
30
+ * TypeError, because module namespace properties are read-only.
31
+ * @param value - `true` to throw on a failed load, `false` to disable sound instead
32
+ * @example
33
+ * // don't abort the whole game when audio fails to load
34
+ * me.audio.setStopOnAudioError(false);
35
+ * @category Audio
36
+ */
37
+ export declare function setStopOnAudioError(value: boolean): void;
21
38
  /**
22
39
  * Cross-module mutable state. A single object so multiple consumers
23
40
  * can read and mutate the same fields without the "ESM `let` exports
@@ -29,14 +46,16 @@ export declare let stopOnAudioError: boolean;
29
46
  * even though the type signature wouldn't normally admit it.
30
47
  * - `currentTrackId` — the name of the currently-playing track managed
31
48
  * by the `playTrack` / `stopTrack` helpers.
32
- * - `retryCounter` — retry counter for `soundLoadError`'s back-off.
49
+ * - `retryCounters` — per-sound retry counters for `soundLoadError`'s
50
+ * back-off, keyed by sound name (a single shared counter let parallel
51
+ * loads steal each other's retry budget).
33
52
  * - `audioExts` — the active list of audio formats set by `init`.
34
53
  * @ignore
35
54
  */
36
55
  export declare const state: {
37
56
  tracks: Record<string, Howl | undefined>;
38
57
  currentTrackId: string | null;
39
- retryCounter: number;
58
+ retryCounters: Record<string, number>;
40
59
  audioExts: string[];
41
60
  };
42
61
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/audio/backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG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GAUG;AACH,eAAO,IAAI,gBAAgB,EAAE,OAAc,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAExD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,KAAK;YACH,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,SAAS,CAAC;oBACtB,MAAM,GAAG,IAAI;mBAChB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;eAC1B,MAAM,EAAE;CACzB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAMxD;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAC1B,YAAY,MAAM,EAClB,aAAa,MAAM,IAAI,EACvB,cAAa,OAAc,KACzB,IAqBF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,IAAI,YAAY,GAAG,IAAI,CAmBrD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,IAAI,QAAQ,GAAG,IAAI,CAS/C;AAUD;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEnD;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAKvC;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAO/C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C"}
@@ -56,34 +56,14 @@ export declare function play(sound_name: string, loop?: boolean, onend?: (() =>
56
56
  * @category Audio
57
57
  */
58
58
  export declare function fade(sound_name: string, from: number, to: number, duration: number, id?: number): void;
59
- /**
60
- * Get or set the playback position of a sound.
61
- * @param sound_name - Audio clip name (case-sensitive).
62
- * @param args - Optional seek position in seconds, optionally followed
63
- * by the sound instance ID.
64
- * @returns The current seek position when no extra arguments are given.
65
- * @example
66
- * // read the current position of the background music
67
- * let current_pos = me.audio.seek("dst-gameforest");
68
- * // rewind the background music to the beginning
69
- * me.audio.seek("dst-gameforest", 0);
70
- * @category Audio
71
- */
72
- export declare function seek(sound_name: string, ...args: number[]): number;
73
- /**
74
- * Get or set the playback rate of a sound.
75
- * @param sound_name - Audio clip name (case-sensitive).
76
- * @param args - Optional playback rate (`0.5..4.0`, where `1.0` is
77
- * normal speed), optionally followed by the sound instance ID.
78
- * @returns The current playback rate when no extra arguments are given.
79
- * @example
80
- * // read the current playback rate
81
- * let rate = me.audio.rate("dst-gameforest");
82
- * // speed it up 2×
83
- * me.audio.rate("dst-gameforest", 2.0);
84
- * @category Audio
85
- */
86
- export declare function rate(sound_name: string, ...args: number[]): number;
59
+ /** @inheritDoc */
60
+ export declare function seek(sound_name: string): number;
61
+ /** @inheritDoc */
62
+ export declare function seek(sound_name: string, seek: number, id?: number): void;
63
+ /** @inheritDoc */
64
+ export declare function rate(sound_name: string): number;
65
+ /** @inheritDoc */
66
+ export declare function rate(sound_name: string, rate: number, id?: number): void;
87
67
  /** @inheritDoc */
88
68
  export declare function stereo(sound_name: string): number;
89
69
  /** @inheritDoc */
@@ -1 +1 @@
1
- {"version":3,"file":"playback.d.ts","sourceRoot":"","sources":["../../src/audio/playback.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CACnB,KAAK,EAAE,UAAU,EACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,EACrB,SAAS,CAAC,EAAE,MAAM,I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AAM,EAAE,CAAC,CAAC,EAAE,QAAQ,GAAG,QAAQ;IAS1D;;;;;;;;OAQG;IACH,0BAA0B,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IA0BpD;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAMhC;;;OAGG;IACM,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI;IA+H7D;;;;;;OAMG;IACH,4BAA4B,CAC3B,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GAChB,IAAI;IAIP;;;;;OAKG;IACH,6BAA6B,CAC5B,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GAChB,IAAI;IAIP;;OAEG;IACM,OAAO,IAAI,IAAI;CAkBxB"}
@@ -1,53 +1,94 @@
1
- export default Path2D;
2
- /**
3
- * additional import for TypeScript
4
- * @import {Point} from "./point.ts";
5
- */
1
+ import { type Point } from "./point.ts";
6
2
  /**
7
- * A simplified Path2D implementation, used internally by both the WebGL and Canvas renderers
8
- * to build and interpolate 2D paths from SVG commands or direct method calls.
3
+ * A 2D path builder used by both the WebGL and Canvas renderers to build and
4
+ * interpolate paths from SVG command strings or direct method calls. Its method
5
+ * semantics follow the standard
6
+ * [Path2D](https://developer.mozilla.org/en-US/docs/Web/API/Path2D) API.
9
7
  *
10
- * This implementation supports a single continuous path (sub-path). SVG strings containing
11
- * multiple `M` (moveTo) commands will be treated as one continuous path rather than
12
- * separate sub-paths, which may produce unexpected fill results for shapes with holes
13
- * or disconnected regions. For complex multi-part shapes, draw each sub-path separately.
8
+ * Each renderer exposes a reusable instance as `renderer.path2D`; you can also
9
+ * create your own with `new Path2D()`. Build a path (via {@link parseSVGPath} or
10
+ * the imperative {@link moveTo}/{@link lineTo}/curve methods), then draw it with
11
+ * the renderer's `stroke()` (outline) and `fill()` (solid) methods. Curves and
12
+ * arcs are flattened into line segments; {@link arcResolution} controls how fine
13
+ * that approximation is.
14
14
  *
15
- * Supported SVG commands: M, L, H, V, Q, C, A, Z (uppercase only).
15
+ * **Sub-paths & holes:** a new sub-path begins on every {@link moveTo} (and on
16
+ * each `M` in an SVG string). When filled, the first sub-path is the outer
17
+ * contour and each subsequent sub-path is treated as a hole — so shapes with
18
+ * holes or disconnected regions (a donut, a ring, the letter "O", text outlines)
19
+ * fill correctly. The Canvas renderer fills via the native non-zero winding rule
20
+ * (so holes should be wound opposite to the outer contour); the WebGL renderer
21
+ * triangulates with holes via earcut, which matches that result for the usual
22
+ * case of oppositely-wound holes. Sub-path boundaries are tracked in
23
+ * {@link subPaths}.
24
+ *
25
+ * Supported SVG commands: `M`, `L`, `H`, `V`, `Q`, `C`, `A`, `Z` (uppercase /
26
+ * absolute only; `H` and `V` take a relative offset).
27
+ * @example
28
+ * // build a path with the imperative API, then fill and outline it
29
+ * const path = renderer.path2D;
30
+ * path.beginPath();
31
+ * path.moveTo(50, 0);
32
+ * path.lineTo(100, 100);
33
+ * path.lineTo(0, 100);
34
+ * path.closePath();
35
+ * renderer.setColor("#4CAF50");
36
+ * renderer.fill(); // fill the current path
37
+ * renderer.setColor("#1B5E20");
38
+ * renderer.stroke(); // outline the current path
39
+ * @example
40
+ * // the same triangle from an SVG path string
41
+ * renderer.path2D.parseSVGPath("M 50 0 L 100 100 L 0 100 Z");
42
+ * renderer.fill();
16
43
  * @category Geometry
17
44
  */
18
45
  declare class Path2D {
19
- constructor(svgPath: any);
20
46
  /**
21
47
  * the points defining the current path
22
- * @type {Point[]}
23
48
  */
24
49
  points: Point[];
50
+ /**
51
+ * start index (into {@link points}) of each sub-path after the first; used
52
+ * as the hole indices when triangulating, and as the `moveTo` boundaries
53
+ * when the Canvas renderer replays the path.
54
+ */
55
+ subPaths: number[];
56
+ /**
57
+ * whether the pen has been explicitly placed (via {@link moveTo}) since
58
+ * the last {@link beginPath} — distinguishes "virgin path" from "pen
59
+ * parked at (0, 0)" so {@link arc}/{@link ellipse}/{@link arcTo} know
60
+ * whether to start fresh or connect from the current point (the native
61
+ * Path2D behavior).
62
+ * @ignore
63
+ */
64
+ private penMoved;
25
65
  /**
26
66
  * space between interpolated points for quadratic and bezier curve approx. in pixels.
27
- * @type {number}
28
67
  * @default 2
29
68
  */
30
69
  arcResolution: number;
31
- vertices: any[];
70
+ vertices: Point[];
32
71
  startPoint: Point;
33
72
  isDirty: boolean;
73
+ constructor(svgPath?: string);
34
74
  /**
35
75
  * Parses an SVG path string and generates interpolated points for rendering.
36
76
  * Clears any existing path data before parsing (calls {@link beginPath} internally).
37
77
  *
38
78
  * Supported commands:
39
- * - **M** x y — move to (sets the starting point)
79
+ * - **M** x y — move to (starts a new sub-path)
40
80
  * - **L** x y — line to
41
81
  * - **H** dx — horizontal line (relative offset from current x)
42
82
  * - **V** dy — vertical line (relative offset from current y)
43
83
  * - **Q** cx cy x y — quadratic Bézier curve
44
84
  * - **C** cx1 cy1 cx2 cy2 x y — cubic Bézier curve
45
85
  * - **A** rx ry xRot largeArc sweep x y — elliptical arc
46
- * - **Z** — close path (line back to the starting M point)
47
- *
48
- * After parsing, the generated points are available in {@link points} and can be
49
- * rendered using the renderer's `stroke()` and `fill()` methods.
86
+ * - **Z** — close the current sub-path (line back to its starting point)
50
87
  *
88
+ * Multiple `M` commands define separate sub-paths; when filled the first is
89
+ * the outer contour and the rest are holes. After parsing, the generated
90
+ * points are available in {@link points} and can be rendered using the
91
+ * renderer's `stroke()` and `fill()` methods.
51
92
  * @example
52
93
  * // draw a heart shape
53
94
  * renderer.path2D.parseSVGPath(
@@ -55,108 +96,180 @@ declare class Path2D {
55
96
  * );
56
97
  * renderer.setColor("#EF5350");
57
98
  * renderer.fill();
58
- *
59
- * @param {string} svgPath - An SVG path data string (e.g. "M 0 0 L 100 0 L 50 100 Z").
60
- * Only uppercase (absolute) commands are supported. The path must be a single
61
- * continuous shape — multiple M commands within one string are not treated as
62
- * separate sub-paths and may produce incorrect fill results.
99
+ * @example
100
+ * // a donut: an outer ring with an inner hole (two `M` sub-paths)
101
+ * renderer.path2D.parseSVGPath(
102
+ * "M 0 40 A 40 40 0 1 0 80 40 A 40 40 0 1 0 0 40 Z " +
103
+ * "M 20 40 A 20 20 0 1 0 60 40 A 20 20 0 1 0 20 40 Z"
104
+ * );
105
+ * renderer.fill();
106
+ * @param svgPath - An SVG path data string (e.g. "M 0 0 L 100 0 L 50 100 Z").
107
+ * Only uppercase (absolute) commands are supported.
63
108
  */
64
109
  parseSVGPath(svgPath: string): void;
65
110
  /**
66
- * begin a new path
111
+ * begin a new (empty) path, discarding all previously recorded points and
112
+ * sub-paths. Called automatically by {@link parseSVGPath}.
113
+ * @example
114
+ * path.beginPath();
115
+ * path.rect(0, 0, 100, 60);
116
+ * renderer.fill();
67
117
  */
68
118
  beginPath(): void;
69
119
  /**
70
- * causes the point of the pen to move back to the start of the current path.
120
+ * causes the point of the pen to move back to the start of the current sub-path.
71
121
  * It tries to draw a straight line from the current point to the start.
72
122
  * If the shape has already been closed or has only one point, this function does nothing.
123
+ * @example
124
+ * path.beginPath();
125
+ * path.moveTo(0, 0);
126
+ * path.lineTo(50, 0);
127
+ * path.lineTo(25, 40);
128
+ * path.closePath(); // draw the final edge back to (0, 0)
73
129
  */
74
130
  closePath(): void;
75
131
  /**
76
- * triangulate the shape defined by this path into an array of triangles
77
- * @returns {Point[]} an array of vertices representing the triangulated path or shape
132
+ * triangulate the shape defined by this path into a flat list of triangle
133
+ * vertices (every three consecutive points form one triangle). Sub-paths
134
+ * after the first are treated as holes. Used by the WebGL renderer to fill,
135
+ * and cached until the path changes.
136
+ * @returns the triangulated vertices, three per triangle
137
+ * @example
138
+ * path.parseSVGPath("M 0 0 L 100 0 L 50 100 Z");
139
+ * const verts = path.triangulatePath(); // 3 vertices = 1 triangle
78
140
  */
79
141
  triangulatePath(): Point[];
80
142
  /**
81
- * moves the starting point of the current path to the (x, y) coordinates.
82
- * @param {number} x - the x-axis (horizontal) coordinate of the point.
83
- * @param {number} y - the y-axis (vertical) coordinate of the point.
143
+ * moves the starting point of a new sub-path to the (x, y) coordinates.
144
+ * @param x - the x-axis (horizontal) coordinate of the point.
145
+ * @param y - the y-axis (vertical) coordinate of the point.
146
+ * @example
147
+ * path.beginPath();
148
+ * path.moveTo(20, 20); // lift the pen to (20, 20): starts a new sub-path
149
+ * path.lineTo(80, 20);
84
150
  */
85
151
  moveTo(x: number, y: number): void;
86
152
  /**
87
- * connects the last point in the current path to the (x, y) coordinates with a straight line.
88
- * @param {number} x - the x-axis coordinate of the line's end point.
89
- * @param {number} y - the y-axis coordinate of the line's end point.
153
+ * Start the outline of an arc/ellipse at (x, y): per the native Path2D
154
+ * spec, when the path already has content the arc is CONNECTED to the
155
+ * current point with a straight line — only a virgin path (no points, no
156
+ * explicit moveTo) starts fresh. An unconditional moveTo here would
157
+ * silently start a new sub-path, which fill() treats as a HOLE cut out
158
+ * of the shape.
159
+ * @ignore
160
+ */
161
+ private connectTo;
162
+ /**
163
+ * connects the last point in the current sub-path to the (x, y) coordinates with a straight line.
164
+ * @param x - the x-axis coordinate of the line's end point.
165
+ * @param y - the y-axis coordinate of the line's end point.
166
+ * @example
167
+ * path.beginPath();
168
+ * path.moveTo(0, 0);
169
+ * path.lineTo(50, 0); // horizontal segment
170
+ * path.lineTo(50, 50); // vertical segment (an "L" shape)
90
171
  */
91
172
  lineTo(x: number, y: number): void;
92
173
  /**
93
174
  * adds an arc to the current path which is centered at (x, y) position with the given radius,
94
175
  * starting at startAngle and ending at endAngle going in the given direction by counterclockwise (defaulting to clockwise).
95
- * @param {number} x - the horizontal coordinate of the arc's center.
96
- * @param {number} y - the vertical coordinate of the arc's center.
97
- * @param {number} radius - the arc's radius. Must be positive.
98
- * @param {number} startAngle - the angle at which the arc starts in radians, measured from the positive x-axis.
99
- * @param {number} endAngle - the angle at which the arc ends in radians, measured from the positive x-axis.
100
- * @param {boolean} [anticlockwise=false] - an optional boolean value. If true, draws the arc counter-clockwise between the start and end angles.
176
+ * @param x - the horizontal coordinate of the arc's center.
177
+ * @param y - the vertical coordinate of the arc's center.
178
+ * @param radius - the arc's radius. Must be positive.
179
+ * @param startAngle - the angle at which the arc starts in radians, measured from the positive x-axis.
180
+ * @param endAngle - the angle at which the arc ends in radians, measured from the positive x-axis.
181
+ * @param [anticlockwise=false] - an optional boolean value. If true, draws the arc counter-clockwise between the start and end angles.
182
+ * @example
183
+ * // a full circle of radius 40 centred at (50, 50)
184
+ * path.beginPath();
185
+ * path.arc(50, 50, 40, 0, Math.PI * 2);
186
+ * renderer.stroke();
101
187
  */
102
188
  arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
103
189
  /**
104
190
  * adds a circular arc to the path with the given control points and radius, connected to the previous point by a straight line.
105
- * @param {number} x1 - the x-axis coordinate of the first control point.
106
- * @param {number} y1 - the y-axis coordinate of the first control point.
107
- * @param {number} x2 - the x-axis coordinate of the second control point.
108
- * @param {number} y2 - the y-axis coordinate of the second control point.
109
- * @param {number} radius - the arc's radius. Must be positive.
191
+ * @param x1 - the x-axis coordinate of the first control point.
192
+ * @param y1 - the y-axis coordinate of the first control point.
193
+ * @param x2 - the x-axis coordinate of the second control point.
194
+ * @param y2 - the y-axis coordinate of the second control point.
195
+ * @param radius - the arc's radius. Must be positive.
196
+ * @example
197
+ * // round the corner where two segments meet at (50, 0)
198
+ * path.beginPath();
199
+ * path.moveTo(0, 0);
200
+ * path.arcTo(50, 0, 50, 50, 20);
201
+ * path.lineTo(50, 50);
110
202
  */
111
203
  arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
112
204
  /**
113
205
  * adds an elliptical arc to the path which is centered at (x, y) position with the radii radiusX and radiusY
114
206
  * starting at startAngle and ending at endAngle going in the given direction by counterclockwise.
115
- * @param {number} x - the x-axis (horizontal) coordinate of the ellipse's center.
116
- * @param {number} y - the y-axis (vertical) coordinate of the ellipse's center.
117
- * @param {number} radiusX - the ellipse's major-axis radius. Must be non-negative.
118
- * @param {number} radiusY - the ellipse's minor-axis radius. Must be non-negative.
119
- * @param {number} rotation - the rotation of the ellipse, expressed in radians.
120
- * @param {number} startAngle - the angle at which the ellipse starts, measured clockwise from the positive x-axis and expressed in radians.
121
- * @param {number} endAngle - the angle at which the ellipse ends, measured clockwise from the positive x-axis and expressed in radians.
122
- * @param {boolean} [anticlockwise=false] - an optional boolean value which, if true, draws the ellipse counterclockwise (anticlockwise).
207
+ * @param x - the x-axis (horizontal) coordinate of the ellipse's center.
208
+ * @param y - the y-axis (vertical) coordinate of the ellipse's center.
209
+ * @param radiusX - the ellipse's major-axis radius. Must be non-negative.
210
+ * @param radiusY - the ellipse's minor-axis radius. Must be non-negative.
211
+ * @param rotation - the rotation of the ellipse, expressed in radians.
212
+ * @param startAngle - the angle at which the ellipse starts, measured clockwise from the positive x-axis and expressed in radians.
213
+ * @param endAngle - the angle at which the ellipse ends, measured clockwise from the positive x-axis and expressed in radians.
214
+ * @param [anticlockwise=false] - an optional boolean value which, if true, draws the ellipse counterclockwise (anticlockwise).
215
+ * @example
216
+ * // a 45°-rotated ellipse, filled
217
+ * path.beginPath();
218
+ * path.ellipse(50, 50, 60, 30, Math.PI / 4, 0, Math.PI * 2);
219
+ * renderer.fill();
123
220
  */
124
221
  ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
125
222
  /**
126
223
  * Adds a quadratic Bézier curve to the path.
127
- * @param {number} cpX - The x-coordinate of the control point.
128
- * @param {number} cpY - The y-coordinate of the control point.
129
- * @param {number} x - The x-coordinate of the end point of the curve.
130
- * @param {number} y - The y-coordinate of the end point of the curve.
224
+ * @param cpX - The x-coordinate of the control point.
225
+ * @param cpY - The y-coordinate of the control point.
226
+ * @param x - The x-coordinate of the end point of the curve.
227
+ * @param y - The y-coordinate of the end point of the curve.
228
+ * @example
229
+ * path.beginPath();
230
+ * path.moveTo(0, 50);
231
+ * path.quadraticCurveTo(50, 0, 100, 50); // one control point at (50, 0)
131
232
  */
132
233
  quadraticCurveTo(cpX: number, cpY: number, x: number, y: number): void;
133
234
  /**
134
235
  * Adds a cubic Bézier curve to the path.
135
- * @param {number} cp1X - The x-coordinate of the first control point.
136
- * @param {number} cp1Y - The y-coordinate of the first control point.
137
- * @param {number} cp2X - The x-coordinate of the second control point.
138
- * @param {number} cp2Y - The y-coordinate of the second control point.
139
- * @param {number} x - The x-coordinate of the end point of the curve.
140
- * @param {number} y - The y-coordinate of the end point of the curve.
236
+ * @param cp1X - The x-coordinate of the first control point.
237
+ * @param cp1Y - The y-coordinate of the first control point.
238
+ * @param cp2X - The x-coordinate of the second control point.
239
+ * @param cp2Y - The y-coordinate of the second control point.
240
+ * @param x - The x-coordinate of the end point of the curve.
241
+ * @param y - The y-coordinate of the end point of the curve.
242
+ * @example
243
+ * path.beginPath();
244
+ * path.moveTo(0, 50);
245
+ * path.bezierCurveTo(25, 0, 75, 100, 100, 50); // two control points
141
246
  */
142
247
  bezierCurveTo(cp1X: number, cp1Y: number, cp2X: number, cp2Y: number, x: number, y: number): void;
143
248
  /**
144
249
  * creates a path for a rectangle at position (x, y) with a size that is determined by width and height.
145
- * @param {number} x - the x-axis coordinate of the rectangle's starting point.
146
- * @param {number} y - the y-axis coordinate of the rectangle's starting point.
147
- * @param {number} width - the rectangle's width. Positive values are to the right, and negative to the left.
148
- * @param {number} height - the rectangle's height. Positive values are down, and negative are up.
250
+ * @param x - the x-axis coordinate of the rectangle's starting point.
251
+ * @param y - the y-axis coordinate of the rectangle's starting point.
252
+ * @param width - the rectangle's width. Positive values are to the right, and negative to the left.
253
+ * @param height - the rectangle's height. Positive values are down, and negative are up.
254
+ * @example
255
+ * path.beginPath();
256
+ * path.rect(10, 10, 80, 50);
257
+ * renderer.fill();
149
258
  */
150
259
  rect(x: number, y: number, width: number, height: number): void;
151
260
  /**
152
261
  * adds an rounded rectangle to the current path.
153
- * @param {number} x - the x-axis coordinate of the rectangle's starting point.
154
- * @param {number} y - the y-axis coordinate of the rectangle's starting point.
155
- * @param {number} width - the rectangle's width. Positive values are to the right, and negative to the left.
156
- * @param {number} height - the rectangle's height. Positive values are down, and negative are up.
157
- * @param {number} radius - the arc's radius to draw the borders. Must be positive.
262
+ * @param x - the x-axis coordinate of the rectangle's starting point.
263
+ * @param y - the y-axis coordinate of the rectangle's starting point.
264
+ * @param width - the rectangle's width. Positive values are to the right, and negative to the left.
265
+ * @param height - the rectangle's height. Positive values are down, and negative are up.
266
+ * @param radius - the arc's radius to draw the borders. Must be positive.
267
+ * @example
268
+ * path.beginPath();
269
+ * path.roundRect(10, 10, 80, 50, 12); // 12px corner radius
270
+ * renderer.fill();
158
271
  */
159
272
  roundRect(x: number, y: number, width: number, height: number, radius: number): void;
160
273
  }
161
- import type { Point } from "./point.ts";
274
+ export default Path2D;
162
275
  //# sourceMappingURL=path2d.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"path2d.d.ts","sourceRoot":"","sources":["../../src/geometries/path2d.js"],"names":[],"mappings":";AAKA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AACH;IACC,0BA0BC;IAzBA;;;OAGG;IACH,QAFU,KAAK,EAAE,CAED;IAEhB;;;;OAIG;IACH,eAHU,MAAM,CAGM;IAGtB,gBAAkB;IAGlB,kBAAiC;IAGjC,iBAAoB;IAOrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,sBALW,MAAM,QA+IhB;IAED;;OAEG;IACH,kBAQC;IAED;;;;OAIG;IACH,kBASC;IAED;;;OAGG;IACH,mBAFa,KAAK,EAAE,CAkCnB;IAED;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAKhB;IAED;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAmBhB;IAED;;;;;;;;;OASG;IACH,OAPW,MAAM,KACN,MAAM,UACN,MAAM,cACN,MAAM,YACN,MAAM,kBACN,OAAO,QA2DjB;IAED;;;;;;;OAOG;IACH,UANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,UACN,MAAM,QAyDhB;IAED;;;;;;;;;;;OAWG;IACH,WATW,MAAM,KACN,MAAM,WACN,MAAM,WACN,MAAM,YACN,MAAM,cACN,MAAM,YACN,MAAM,kBACN,OAAO,QA4EjB;IAED;;;;;;OAMG;IACH,sBALW,MAAM,OACN,MAAM,KACN,MAAM,KACN,MAAM,QA8BhB;IAED;;;;;;;;OAQG;IACH,oBAPW,MAAM,QACN,MAAM,QACN,MAAM,QACN,MAAM,KACN,MAAM,KACN,MAAM,QA0ChB;IAED;;;;;;OAMG;IACH,QALW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QAgBhB;IAED;;;;;;;OAOG;IACH,aANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,UACN,MAAM,QAoBhB;CACD;2BAnqBuB,YAAY"}
1
+ {"version":3,"file":"path2d.d.ts","sourceRoot":"","sources":["../../src/geometries/path2d.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,KAAK,EAAa,MAAM,YAAY,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,cAAM,MAAM;IACX;;OAEG;IACH,MAAM,EAAE,KAAK,EAAE,CAAM;IAErB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAM;IAExB;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ,CAAS;IAEzB;;;OAGG;IACH,aAAa,SAAK;IAGlB,QAAQ,EAAE,KAAK,EAAE,CAAM;IAGvB,UAAU,EAAE,KAAK,CAAmB;IAGpC,OAAO,UAAS;gBAEJ,OAAO,CAAC,EAAE,MAAM;IAM5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM;IA0J5B;;;;;;;OAOG;IACH,SAAS;IAYT;;;;;;;;;;OAUG;IACH,SAAS;IA0BT;;;;;;;;;OASG;IACH,eAAe;IAsCf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ED;;OAEG;IACH,IAAI,MAAM,WAET;IACD,IAAI,MAAM,CAAC,KAAK,QAAA,EAIf;IAED;;OAEG;IACH,IAAI,OAAO,WAMV;IACD,IAAI,OAAO,CAAC,KAAK,QAAA,EAIhB;IAED;;OAEG;IACH,IAAI,OAAO,WAMV;IACD,IAAI,OAAO,CAAC,KAAK,QAAA,EAIhB;IAED;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAM7B;;;;;OAKG;IACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAM3B;;;;;OAKG;IACM,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,SAAI;IAM/B;;;OAGG;IACM,KAAK;IAId;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,IAAI;IAMf;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,IAAI;IAchB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,IAAI;IASV,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO;IACvC,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO;IAsB5C;;;;;;;;OAQG;IACH,iBAAiB,CAAC,SAAS,EAAE,IAAI;IASjC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,IAAI;IASjB;;;OAGG;IACH,QAAQ;IASR;;;OAGG;IACH,SAAS;CAYT;AAED,eAAO,MAAM,QAAQ,+FAYnB,CAAC"}
package/build/index.d.ts CHANGED
@@ -62,6 +62,8 @@ import RenderState from "./video/renderstate.js";
62
62
  import CanvasRenderTarget from "./video/rendertarget/canvasrendertarget.js";
63
63
  import RenderTarget from "./video/rendertarget/rendertarget.ts";
64
64
  import { TextureAtlas } from "./video/texture/atlas.js";
65
+ import NoiseTexture2d from "./video/texture/noise_texture2d.js";
66
+ import Texture2d from "./video/texture/texture2d.ts";
65
67
  import { Batcher } from "./video/webgl/batchers/batcher.js";
66
68
  import PrimitiveBatcher from "./video/webgl/batchers/primitive_batcher.js";
67
69
  import QuadBatcher from "./video/webgl/batchers/quad_batcher.js";
@@ -108,6 +110,8 @@ export { Color } from "./math/color.ts";
108
110
  export * as math from "./math/math.ts";
109
111
  export { Matrix2d } from "./math/matrix2d.ts";
110
112
  export { Matrix3d } from "./math/matrix3d.ts";
113
+ export type { FractalType, NoiseSettings, NoiseType } from "./math/noise.ts";
114
+ export { Noise } from "./math/noise.ts";
111
115
  export { ObservableVector2d } from "./math/observableVector2d.ts";
112
116
  export { ObservableVector3d } from "./math/observableVector3d.ts";
113
117
  export { Vector2d } from "./math/vector2d.ts";
@@ -125,7 +129,7 @@ export * as utils from "./utils/utils.ts";
125
129
  export * from "./version.ts";
126
130
  export * as video from "./video/video.js";
127
131
  export { Application, Batcher, BitmapText, BitmapTextData, BlurEffect, Body, Camera2d, Camera3d, CameraEffect, CanvasRenderer, CanvasRenderTarget, ChromaticAberrationEffect, Collectable, ColorLayer, ColorMatrix, ColorMatrixEffect, Container, DesaturateEffect, DissolveEffect, Draggable, DropShadowEffect, DropTarget, Entity, // eslint-disable-line @typescript-eslint/no-deprecated
128
- FadeEffect, FlashEffect, FrameAnimation, Frustum, GLShader, GLTFModel, GlowEffect, Gradient, HologramEffect, ImageLayer, InvertEffect, Light2d, MaskEffect, Mesh, NineSliceSprite, OutlineEffect, Particle, ParticleEmitter, ParticleEmitterSettings, PixelateEffect, Pointer, PrimitiveBatcher, plugins, pool, QuadBatcher, Renderable, Renderer, RenderState, RenderTarget, ScanlineEffect, SepiaEffect, ShaderEffect, ShakeEffect, ShineEffect, Sprite, Sprite3d, Stage, save, state, Text, TextureAtlas, Tile, TintPulseEffect, TMXHexagonalRenderer, TMXIsometricRenderer, TMXLayer, TMXOrthogonalRenderer, TMXRenderer, TMXStaggeredRenderer, TMXTileMap, TMXTileset, TMXTilesetGroup, TMXUtils, Trail, Trigger, Tween, timer, UIBaseElement, UISpriteElement, UITextButton, VignetteEffect, WaveEffect, WebGLRenderer, World, };
132
+ FadeEffect, FlashEffect, FrameAnimation, Frustum, GLShader, GLTFModel, GlowEffect, Gradient, HologramEffect, ImageLayer, InvertEffect, Light2d, MaskEffect, Mesh, NineSliceSprite, NoiseTexture2d, OutlineEffect, Particle, ParticleEmitter, ParticleEmitterSettings, PixelateEffect, Pointer, PrimitiveBatcher, plugins, pool, QuadBatcher, Renderable, Renderer, RenderState, RenderTarget, ScanlineEffect, SepiaEffect, ShaderEffect, ShakeEffect, ShineEffect, Sprite, Sprite3d, Stage, save, state, Text, Texture2d, TextureAtlas, Tile, TintPulseEffect, TMXHexagonalRenderer, TMXIsometricRenderer, TMXLayer, TMXOrthogonalRenderer, TMXRenderer, TMXStaggeredRenderer, TMXTileMap, TMXTileset, TMXTilesetGroup, TMXUtils, Trail, Trigger, Tween, timer, UIBaseElement, UISpriteElement, UITextButton, VignetteEffect, WaveEffect, WebGLRenderer, World, };
129
133
  /**
130
134
  * disable melonJS auto-initialization
131
135
  * @see {@link boot}