melonjs 20.2.0 → 20.3.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.
- package/README.md +86 -8
- package/build/application/settings.d.ts +3 -2
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts +2 -2
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/backend/buffer.d.ts +26 -0
- package/build/audio/backend/buffer.d.ts.map +1 -0
- package/build/audio/backend/cache.d.ts +2 -0
- package/build/audio/backend/cache.d.ts.map +1 -0
- package/build/audio/backend/core.d.ts +24 -0
- package/build/audio/backend/core.d.ts.map +1 -0
- package/build/audio/backend/engine.d.ts +54 -0
- package/build/audio/backend/engine.d.ts.map +1 -0
- package/build/audio/backend/sound.d.ts +79 -0
- package/build/audio/backend/sound.d.ts.map +1 -0
- package/build/audio/backend/spatial.d.ts +191 -0
- package/build/audio/backend/spatial.d.ts.map +1 -0
- package/build/audio/backend/types.d.ts +97 -0
- package/build/audio/backend/types.d.ts.map +1 -0
- package/build/audio/backend/voice.d.ts +33 -0
- package/build/audio/backend/voice.d.ts.map +1 -0
- package/build/audio/playback.d.ts +49 -4
- package/build/audio/playback.d.ts.map +1 -1
- package/build/audio/{backend.d.ts → state.d.ts} +13 -11
- package/build/audio/state.d.ts.map +1 -0
- package/build/audio/types.d.ts +93 -1
- package/build/audio/types.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +5 -5
- package/build/const.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +8793 -10171
- package/build/index.js.map +4 -4
- package/build/input/input.d.ts +19 -0
- package/build/input/input.d.ts.map +1 -1
- package/build/lang/deprecated.d.ts +4 -2
- package/build/lang/deprecated.d.ts.map +1 -1
- package/build/level/gltf/GLTFScene.d.ts +12 -0
- package/build/level/gltf/GLTFScene.d.ts.map +1 -1
- package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
- package/build/loader/loader.d.ts +4 -40
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/parsers/audio.d.ts +31 -0
- package/build/loader/parsers/audio.d.ts.map +1 -0
- package/build/loader/parsers/shader.d.ts.map +1 -1
- package/build/physics/adapter.d.ts +3 -3
- package/build/physics/builtin/body.d.ts +23 -24
- package/build/physics/builtin/body.d.ts.map +1 -1
- package/build/physics/builtin/detector.d.ts +1 -1
- package/build/plugin/plugin.d.ts +9 -1
- package/build/plugin/plugin.d.ts.map +1 -1
- package/build/polyfill/index.d.ts +1 -4
- package/build/polyfill/index.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +16 -0
- package/build/renderable/mesh.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +16 -10
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +7 -7
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/state/stage.d.ts +4 -2
- package/build/state/stage.d.ts.map +1 -1
- package/build/system/event.d.ts +1 -1
- package/build/system/platform.d.ts +21 -1
- package/build/system/platform.d.ts.map +1 -1
- package/build/utils/fetchdata.d.ts.map +1 -0
- package/build/video/blendmodes.d.ts +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +5 -2
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/effects/blur.d.ts +4 -4
- package/build/video/effects/blur.d.ts.map +1 -1
- package/build/video/effects/chromaticAberration.d.ts +5 -5
- package/build/video/effects/chromaticAberration.d.ts.map +1 -1
- package/build/video/effects/colorMatrix.d.ts +5 -5
- package/build/video/effects/colorMatrix.d.ts.map +1 -1
- package/build/video/effects/desaturate.d.ts +5 -5
- package/build/video/effects/desaturate.d.ts.map +1 -1
- package/build/video/effects/dissolve.d.ts +4 -4
- package/build/video/effects/dissolve.d.ts.map +1 -1
- package/build/video/effects/dropShadow.d.ts +5 -5
- package/build/video/effects/dropShadow.d.ts.map +1 -1
- package/build/video/effects/flash.d.ts +4 -4
- package/build/video/effects/flash.d.ts.map +1 -1
- package/build/video/effects/glow.d.ts +5 -5
- package/build/video/effects/glow.d.ts.map +1 -1
- package/build/video/effects/hologram.d.ts +4 -4
- package/build/video/effects/hologram.d.ts.map +1 -1
- package/build/video/effects/invert.d.ts +5 -5
- package/build/video/effects/invert.d.ts.map +1 -1
- package/build/video/effects/outline.d.ts +6 -6
- package/build/video/effects/outline.d.ts.map +1 -1
- package/build/video/effects/pixelate.d.ts +4 -4
- package/build/video/effects/pixelate.d.ts.map +1 -1
- package/build/video/effects/radialGradient.d.ts +2 -2
- package/build/video/effects/scanline.d.ts +6 -6
- package/build/video/effects/scanline.d.ts.map +1 -1
- package/build/video/effects/sepia.d.ts +5 -5
- package/build/video/effects/sepia.d.ts.map +1 -1
- package/build/video/effects/shadereffect.d.ts +12 -10
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/effects/shine.d.ts +3 -3
- package/build/video/effects/shine.d.ts.map +1 -1
- package/build/video/effects/tintPulse.d.ts +4 -4
- package/build/video/effects/tintPulse.d.ts.map +1 -1
- package/build/video/effects/vignette.d.ts +6 -6
- package/build/video/effects/vignette.d.ts.map +1 -1
- package/build/video/effects/wave.d.ts +4 -4
- package/build/video/effects/wave.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +1 -1
- package/build/video/webgl/glshader.d.ts +2 -2
- package/build/video/webgl/webgl_renderer.d.ts +2 -1
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/webgpu_renderer.d.ts +2 -1
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +5 -9
- package/skills/AGENTS.md +67 -0
- package/skills/melonjs/SKILL.md +156 -0
- package/skills/melonjs-20-migration/SKILL.md +160 -0
- package/skills/melonjs-3d/SKILL.md +226 -0
- package/skills/melonjs-3d-assets/SKILL.md +239 -0
- package/skills/melonjs-audio/SKILL.md +215 -0
- package/skills/melonjs-camera-and-drawing/SKILL.md +171 -0
- package/skills/melonjs-deployment/SKILL.md +113 -0
- package/skills/melonjs-effects-and-shaders/SKILL.md +177 -0
- package/skills/melonjs-events/SKILL.md +159 -0
- package/skills/melonjs-getting-started/SKILL.md +183 -0
- package/skills/melonjs-input/SKILL.md +166 -0
- package/skills/melonjs-lighting/SKILL.md +139 -0
- package/skills/melonjs-loading-assets/SKILL.md +157 -0
- package/skills/melonjs-particles-and-trails/SKILL.md +136 -0
- package/skills/melonjs-performance/SKILL.md +178 -0
- package/skills/melonjs-physics/SKILL.md +321 -0
- package/skills/melonjs-plugins/SKILL.md +191 -0
- package/skills/melonjs-renderables/SKILL.md +214 -0
- package/skills/melonjs-renderer-backends/SKILL.md +173 -0
- package/skills/melonjs-scenes-and-state/SKILL.md +180 -0
- package/skills/melonjs-sprites-and-animation/SKILL.md +173 -0
- package/skills/melonjs-tilemaps/SKILL.md +193 -0
- package/skills/melonjs-ui-and-text/SKILL.md +175 -0
- package/build/audio/backend.d.ts.map +0 -1
- package/build/loader/parsers/fetchdata.d.ts.map +0 -1
- /package/build/{loader/parsers → utils}/fetchdata.d.ts +0 -0
package/build/system/event.d.ts
CHANGED
|
@@ -288,7 +288,7 @@ export declare const VIEWPORT_ONCHANGE = "viewport.onchange";
|
|
|
288
288
|
export declare const ONCONTEXT_LOST = "renderer.contextlost";
|
|
289
289
|
/**
|
|
290
290
|
* Event for when the current context is restored <br>
|
|
291
|
-
* Data passed : {me.Renderer} the current renderer instance
|
|
291
|
+
* Data passed : {me.Renderer} the current renderer instance
|
|
292
292
|
* @see event.on
|
|
293
293
|
*/
|
|
294
294
|
export declare const ONCONTEXT_RESTORED = "renderer.contextrestored";
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* android2 `true` if the device is an Android 2.x platform (deprecated)
|
|
9
9
|
* linux `true` if the device is a Linux platform
|
|
10
10
|
* chromeOS `true` if the device is running on ChromeOS.
|
|
11
|
+
* appleVendor `true` if the browser reports an Apple vendor (Safari)
|
|
11
12
|
* wp `true` if the device is a Windows Phone platform (deprecated)
|
|
12
13
|
* BlackBerry `true` if the device is a BlackBerry platform (deprecated)
|
|
13
14
|
* Kindle `true` if the device is a Kindle platform (deprecated)
|
|
@@ -19,6 +20,13 @@
|
|
|
19
20
|
*/
|
|
20
21
|
export declare const ua: string;
|
|
21
22
|
export declare const iOS: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* `true` when the browser reports an Apple vendor string — Safari on
|
|
25
|
+
* macOS or iOS. Distinct from {@link iOS}: a Mac running Safari is
|
|
26
|
+
* `appleVendor` but not `iOS`, and Chrome on iOS is `iOS` but not
|
|
27
|
+
* `appleVendor`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const appleVendor: boolean;
|
|
22
30
|
export declare const android: boolean;
|
|
23
31
|
/**
|
|
24
32
|
* @deprecated since 19.7.0 — Android 2.x predates 2012. Will be removed in 20.x.
|
|
@@ -35,7 +43,19 @@ export declare const wp: boolean;
|
|
|
35
43
|
*/
|
|
36
44
|
export declare const BlackBerry: boolean;
|
|
37
45
|
/**
|
|
38
|
-
*
|
|
46
|
+
* `true` on Amazon devices — Fire tablets (which report the Silk browser) and
|
|
47
|
+
* legacy Kindle e-readers.
|
|
48
|
+
*
|
|
49
|
+
* The previous pattern required `Silk` followed by `Mobile Safari`, which no
|
|
50
|
+
* current Fire tablet sends: Chromium-based Silk ends its user agent with
|
|
51
|
+
* `Safari/537.36`, so every modern Fire tablet went undetected. Silk is
|
|
52
|
+
* Amazon-only, so matching the `Silk/` token directly is both narrower and
|
|
53
|
+
* correct.
|
|
54
|
+
*
|
|
55
|
+
* Note these devices are ordinary Android: {@link android} is `true` for all of
|
|
56
|
+
* them, and nothing in the engine branches on this constant.
|
|
57
|
+
* @deprecated since 19.7.0 — Kindle behaves like Android and {@link android}
|
|
58
|
+
* already covers it. Will be removed in a future release.
|
|
39
59
|
*/
|
|
40
60
|
export declare const Kindle: boolean;
|
|
41
61
|
export declare const ejecta: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/system/platform.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/system/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,EAAE,QAGT,CAAC;AA0DP,eAAO,MAAM,GAAG,SAAsD,CAAC;AACvE;;;;;GAKG;AACH,eAAO,MAAM,WAAW,SAAyB,CAAC;AAClD,eAAO,MAAM,OAAO,SAAsB,CAAC;AAC3C;;GAEG;AACH,eAAO,MAAM,QAAQ,SAAwB,CAAC;AAC9C,eAAO,MAAM,KAAK,SAAoB,CAAC;AACvC,eAAO,MAAM,QAAQ,SAAkB,CAAC;AACxC;;GAEG;AACH,eAAO,MAAM,EAAE,SAA4B,CAAC;AAC5C;;GAEG;AACH,eAAO,MAAM,UAAU,SAAyB,CAAC;AACjD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,MAAM,SAA4B,CAAC;AAChD,eAAO,MAAM,MAAM,SAAyB,CAAC;AAC7C,eAAO,MAAM,QAAQ,SAA6B,CAAC;AAOnD,eAAO,MAAM,MAAM,SAGW,CAAC;AAO/B,eAAO,MAAM,QAAQ,SAAqC,CAAC;AAC3D,eAAO,MAAM,MAAM,SAK2C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchdata.d.ts","sourceRoot":"","sources":["../../src/utils/fetchdata.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,oCALW,MAAM,aACN,MAAM,GACJ,OAAO,CAKnB;AA2DD;;;;;;;;;;;;;;;GAeG;AACH,+BAdW,MAAM,gBACN,MAAM,aACN,MAAM,gBAkDhB"}
|
|
@@ -17,7 +17,7 @@ export function advancedBlendModeIndex(mode: string): number;
|
|
|
17
17
|
* `lighter` are spellings of `additive`, and anything unrecognized collapses
|
|
18
18
|
* to `normal`.
|
|
19
19
|
*
|
|
20
|
-
* The
|
|
20
|
+
* The advanced modes normalize to `"normal"` on purpose — that is their
|
|
21
21
|
* PIPELINE state, since the geometry really does rasterize under ordinary
|
|
22
22
|
* source-over before the shader composites it. Use {@link isAdvancedBlendMode}
|
|
23
23
|
* to ask the other question, and {@link reportedBlendMode} for what
|
|
@@ -27,7 +27,7 @@ export default class CanvasRenderer extends Renderer {
|
|
|
27
27
|
setProjection(matrix: Matrix3d): void;
|
|
28
28
|
/**
|
|
29
29
|
* set the current blend mode for this renderer. <br>
|
|
30
|
-
*
|
|
30
|
+
* This renderer supports every mode below except `"none"`: <br>
|
|
31
31
|
* - "normal" : draws new content on top of the existing content <br>
|
|
32
32
|
* <img src="../images/normal-blendmode.png" width="180"/> <br>
|
|
33
33
|
* - "add", "additive", or "lighter" : color values are added together <br>
|
|
@@ -55,7 +55,10 @@ export default class CanvasRenderer extends Renderer {
|
|
|
55
55
|
* - "exclusion" : like difference, but lower in contrast <br>
|
|
56
56
|
* <img src="../images/exclusion-blendmode.png" width="180"/> <br>
|
|
57
57
|
* - "none" : blending disabled — the source replaces the destination
|
|
58
|
-
* outright, alpha included
|
|
58
|
+
* outright, alpha included. **GPU backends only**: there is no
|
|
59
|
+
* `globalCompositeOperation` that disables blending for the drawn area
|
|
60
|
+
* alone (`"copy"` clears the rest of the surface), so this renderer falls
|
|
61
|
+
* back to "normal" and reports it <br>
|
|
59
62
|
* A few draw types cannot honour every mode — 3D meshes, and fills using
|
|
60
63
|
* a {@link Gradient} — and fall back to "normal" with a one-time console
|
|
61
64
|
* warning. `setBlendMode` returns what it actually applied, so comparing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/canvas/canvas_renderer.js"],"names":[],"mappings":"AAcA;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH;IAiBE,oBAAmC;IAiCnC,wBAEC;IAyBD,8CAA4B;IAyE1B,mBAA0B;IA6B7B;;;;;OAKG;IACH,sBAFW,QAAQ,QAclB;IAED
|
|
1
|
+
{"version":3,"file":"canvas_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/canvas/canvas_renderer.js"],"names":[],"mappings":"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"}
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
* Commonly used for background defocus, depth-of-field simulation,
|
|
4
4
|
* or UI backdrop blur.
|
|
5
5
|
* @category Effects
|
|
6
|
-
* @see {@link Renderable
|
|
6
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
7
7
|
* @example
|
|
8
8
|
* // moderate blur
|
|
9
|
-
* mySprite.
|
|
9
|
+
* mySprite.addPostEffect(new BlurEffect(renderer, { strength: 2.0 }));
|
|
10
10
|
*/
|
|
11
11
|
export default class BlurEffect extends ShaderEffect {
|
|
12
12
|
/**
|
|
13
|
-
* @param {
|
|
13
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
14
14
|
* @param {object} [options] - effect options
|
|
15
15
|
* @param {number} [options.strength=1.0] - blur strength in texels
|
|
16
16
|
* @param {number[]} [options.textureSize=[256, 256]] - texture dimensions [width, height]
|
|
17
17
|
*/
|
|
18
|
-
constructor(renderer:
|
|
18
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
19
19
|
strength?: number | undefined;
|
|
20
20
|
textureSize?: number[] | undefined;
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../src/video/effects/blur.js"],"names":[],"mappings":"AA4BA;;;;;;;;;GASG;AACH;IACC;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../src/video/effects/blur.js"],"names":[],"mappings":"AA4BA;;;;;;;;;GASG;AACH;IACC;;;;;OAKG;IACH,sBALW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,QAAQ;QACN,WAAW;KACxC,EA8BA;IALA,iBAAuC;IAOxC;;;OAGG;IACH,sBAFW,MAAM,QAKhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBA7FwB,mBAAmB"}
|
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
* chromatic aberration (color fringe) effect. Commonly used for
|
|
4
4
|
* impact feedback, glitch effects, or damage indicators.
|
|
5
5
|
* @category Effects
|
|
6
|
-
* @see {@link Renderable
|
|
6
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
7
7
|
* @example
|
|
8
8
|
* // subtle chromatic aberration
|
|
9
|
-
* mySprite.
|
|
9
|
+
* mySprite.addPostEffect(new ChromaticAberrationEffect(renderer, { offset: 2.0 }));
|
|
10
10
|
* @example
|
|
11
11
|
* // strong glitch effect
|
|
12
|
-
* mySprite.
|
|
12
|
+
* mySprite.addPostEffect(new ChromaticAberrationEffect(renderer, { offset: 5.0 }));
|
|
13
13
|
*/
|
|
14
14
|
export default class ChromaticAberrationEffect extends ShaderEffect {
|
|
15
15
|
/**
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
17
17
|
* @param {object} [options] - effect options
|
|
18
18
|
* @param {number} [options.offset=3.0] - channel offset in texels
|
|
19
19
|
* @param {number[]} [options.textureSize=[256, 256]] - texture dimensions [width, height]
|
|
20
20
|
*/
|
|
21
|
-
constructor(renderer:
|
|
21
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
22
22
|
offset?: number | undefined;
|
|
23
23
|
textureSize?: number[] | undefined;
|
|
24
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chromaticAberration.d.ts","sourceRoot":"","sources":["../../../src/video/effects/chromaticAberration.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;GAYG;AACH;IACC;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"chromaticAberration.d.ts","sourceRoot":"","sources":["../../../src/video/effects/chromaticAberration.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;GAYG;AACH;IACC;;;;;OAKG;IACH,sBALW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,MAAM;QACJ,WAAW;KACxC,EAuBA;IALA,eAAmC;IAOpC;;;OAGG;IACH,kBAFW,MAAM,QAKhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBAlFwB,mBAAmB"}
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
* A shader effect that applies a 4x4 color transformation matrix.
|
|
3
3
|
* Provides chainable color adjustment methods that automatically update the GPU uniform.
|
|
4
4
|
* @category Effects
|
|
5
|
-
* @see {@link Renderable
|
|
5
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
6
6
|
* @example
|
|
7
7
|
* // desaturate a sprite
|
|
8
|
-
* mySprite.
|
|
8
|
+
* mySprite.addPostEffect(new ColorMatrixEffect(renderer).saturate(0.0));
|
|
9
9
|
* @example
|
|
10
10
|
* // combine brightness + contrast on a camera
|
|
11
|
-
* camera.
|
|
11
|
+
* camera.addPostEffect(new ColorMatrixEffect(renderer).brightness(1.3).contrast(1.5));
|
|
12
12
|
* @example
|
|
13
13
|
* // update dynamically
|
|
14
14
|
* effect.reset().brightness(1.5).saturate(0.5);
|
|
15
15
|
*/
|
|
16
16
|
export default class ColorMatrixEffect extends ShaderEffect {
|
|
17
17
|
/**
|
|
18
|
-
* @param {
|
|
18
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
19
19
|
* @param {object} [options] - effect options
|
|
20
20
|
* @param {ColorMatrix} [options.matrix] - an initial color matrix. Defaults to identity.
|
|
21
21
|
*/
|
|
22
|
-
constructor(renderer:
|
|
22
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
23
23
|
matrix?: ColorMatrix | undefined;
|
|
24
24
|
});
|
|
25
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorMatrix.d.ts","sourceRoot":"","sources":["../../../src/video/effects/colorMatrix.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"colorMatrix.d.ts","sourceRoot":"","sources":["../../../src/video/effects/colorMatrix.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;OAIG;IACH,sBAJW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAA8B,MAAM;KACtC,EAkBA;IANA;;;OAGG;IACH,qBAAkD;IAInD;;;OAGG;IACH,qBAEC;IAED;;;OAGG;IACH,SAFa,IAAI,CAMhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,WAAW,GACT,IAAI,CAMhB;IAED;;;;;OAKG;IACH,mBAHc,MAAM,EAAA,GACP,IAAI,CAMhB;CACD;yBAjKwB,mBAAmB;4BADhB,4BAA4B"}
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
* A shader effect that desaturates (grayscales) the sprite.
|
|
3
3
|
* Commonly used for disabled states, death effects, or petrification.
|
|
4
4
|
* @category Effects
|
|
5
|
-
* @see {@link Renderable
|
|
5
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
6
6
|
* @example
|
|
7
7
|
* // full grayscale
|
|
8
|
-
* mySprite.
|
|
8
|
+
* mySprite.addPostEffect(new DesaturateEffect(renderer));
|
|
9
9
|
* @example
|
|
10
10
|
* // partial desaturation (50%)
|
|
11
|
-
* mySprite.
|
|
11
|
+
* mySprite.addPostEffect(new DesaturateEffect(renderer, { intensity: 0.5 }));
|
|
12
12
|
*/
|
|
13
13
|
export default class DesaturateEffect extends ColorMatrixEffect {
|
|
14
14
|
/**
|
|
15
|
-
* @param {
|
|
15
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
16
16
|
* @param {object} [options] - effect options
|
|
17
17
|
* @param {number} [options.intensity=1.0] - desaturation intensity (0.0 = full color, 1.0 = grayscale)
|
|
18
18
|
*/
|
|
19
|
-
constructor(renderer:
|
|
19
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
20
20
|
intensity?: number | undefined;
|
|
21
21
|
});
|
|
22
22
|
intensity: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"desaturate.d.ts","sourceRoot":"","sources":["../../../src/video/effects/desaturate.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH;IACC;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"desaturate.d.ts","sourceRoot":"","sources":["../../../src/video/effects/desaturate.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH;IACC;;;;OAIG;IACH,sBAJW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,SAAS;KACpC,EAMA;IAHA,kBACgE;IAIjE;;;OAGG;IACH,oBAFW,MAAM,QAKhB;CACD;8BAnC6B,kBAAkB"}
|
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
* `progress` value increases from 0 to 1.
|
|
5
5
|
* Commonly used for death, spawn, or teleport effects.
|
|
6
6
|
* @category Effects
|
|
7
|
-
* @see {@link Renderable
|
|
7
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
8
8
|
* @example
|
|
9
9
|
* // create a dissolve effect
|
|
10
10
|
* const dissolve = new DissolveEffect(renderer);
|
|
11
|
-
* mySprite.
|
|
11
|
+
* mySprite.addPostEffect(dissolve);
|
|
12
12
|
*
|
|
13
13
|
* // animate the dissolve (0 = fully visible, 1 = fully dissolved)
|
|
14
14
|
* dissolve.setProgress(0.5);
|
|
15
15
|
*/
|
|
16
16
|
export default class DissolveEffect extends ShaderEffect {
|
|
17
17
|
/**
|
|
18
|
-
* @param {
|
|
18
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
19
19
|
* @param {object} [options] - effect options
|
|
20
20
|
* @param {number} [options.progress=0.0] - dissolve progress (0.0 = visible, 1.0 = dissolved)
|
|
21
21
|
* @param {number[]} [options.edgeColor=[1.0, 0.5, 0.0]] - color of the dissolve edge
|
|
22
22
|
* @param {number} [options.edgeWidth=0.1] - width of the colored edge (0.0–1.0)
|
|
23
23
|
*/
|
|
24
|
-
constructor(renderer:
|
|
24
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
25
25
|
progress?: number | undefined;
|
|
26
26
|
edgeColor?: number[] | undefined;
|
|
27
27
|
edgeWidth?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dissolve.d.ts","sourceRoot":"","sources":["../../../src/video/effects/dissolve.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;;;OAMG;IACH,
|
|
1
|
+
{"version":3,"file":"dissolve.d.ts","sourceRoot":"","sources":["../../../src/video/effects/dissolve.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;;;OAMG;IACH,sBANW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,QAAQ;QACN,SAAS;QACX,SAAS;KACpC,EA0DA;IAPA,iBAAuC;IASxC;;;OAGG;IACH,mBAFW,MAAM,QAKhB;IAED;;;OAGG;IACH,oBAFW,MAAM,EAAE,QAIlB;CACD;yBAhKwB,mBAAmB"}
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
* Works by sampling the texture at an offset — if the offset position
|
|
4
4
|
* has an opaque pixel but the current position doesn't, the shadow is drawn.
|
|
5
5
|
* @category Effects
|
|
6
|
-
* @see {@link Renderable
|
|
6
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
7
7
|
* @example
|
|
8
8
|
* // dark shadow offset to the bottom-right
|
|
9
|
-
* mySprite.
|
|
9
|
+
* mySprite.addPostEffect(new DropShadowEffect(renderer, {
|
|
10
10
|
* offsetX: 3.0,
|
|
11
11
|
* offsetY: 3.0,
|
|
12
12
|
* color: [0.0, 0.0, 0.0],
|
|
13
13
|
* opacity: 0.5,
|
|
14
|
-
* });
|
|
14
|
+
* }));
|
|
15
15
|
*/
|
|
16
16
|
export default class DropShadowEffect extends ShaderEffect {
|
|
17
17
|
/**
|
|
18
|
-
* @param {
|
|
18
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
19
19
|
* @param {object} [options] - effect options
|
|
20
20
|
* @param {number} [options.offsetX=2.0] - shadow x offset in texels
|
|
21
21
|
* @param {number} [options.offsetY=2.0] - shadow y offset in texels
|
|
@@ -23,7 +23,7 @@ export default class DropShadowEffect extends ShaderEffect {
|
|
|
23
23
|
* @param {number} [options.opacity=0.5] - shadow opacity (0.0–1.0)
|
|
24
24
|
* @param {number[]} [options.textureSize=[256, 256]] - texture dimensions [width, height]
|
|
25
25
|
*/
|
|
26
|
-
constructor(renderer:
|
|
26
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
27
27
|
offsetX?: number | undefined;
|
|
28
28
|
offsetY?: number | undefined;
|
|
29
29
|
color?: number[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropShadow.d.ts","sourceRoot":"","sources":["../../../src/video/effects/dropShadow.js"],"names":[],"mappings":"AAkCA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;;;;;OAQG;IACH,
|
|
1
|
+
{"version":3,"file":"dropShadow.d.ts","sourceRoot":"","sources":["../../../src/video/effects/dropShadow.js"],"names":[],"mappings":"AAkCA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;;;;;OAQG;IACH,sBARW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,OAAO;QACP,OAAO;QACL,KAAK;QACP,OAAO;QACL,WAAW;KACxC,EA0CA;IAED;;;;OAIG;IACH,aAHW,MAAM,KACN,MAAM,QAIhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBAvHwB,mBAAmB"}
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* The `intensity` uniform controls how much of the flash color is mixed in
|
|
5
5
|
* (0.0 = original sprite, 1.0 = fully colored).
|
|
6
6
|
* @category Effects
|
|
7
|
-
* @see {@link Renderable
|
|
7
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
8
8
|
* @example
|
|
9
9
|
* // create a white flash effect
|
|
10
10
|
* const flash = new FlashEffect(renderer);
|
|
11
|
-
* mySprite.
|
|
11
|
+
* mySprite.addPostEffect(flash);
|
|
12
12
|
*
|
|
13
13
|
* // trigger the flash (e.g. on hit)
|
|
14
14
|
* flash.setIntensity(1.0);
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
*/
|
|
22
22
|
export default class FlashEffect extends ShaderEffect {
|
|
23
23
|
/**
|
|
24
|
-
* @param {
|
|
24
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
25
25
|
* @param {object} [options] - effect options
|
|
26
26
|
* @param {number[]} [options.color=[1.0, 1.0, 1.0]] - flash color as [r, g, b] (0.0–1.0)
|
|
27
27
|
* @param {number} [options.intensity=0.0] - initial flash intensity (0.0–1.0)
|
|
28
28
|
*/
|
|
29
|
-
constructor(renderer:
|
|
29
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
30
30
|
color?: number[] | undefined;
|
|
31
31
|
intensity?: number | undefined;
|
|
32
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flash.d.ts","sourceRoot":"","sources":["../../../src/video/effects/flash.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IACC;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"flash.d.ts","sourceRoot":"","sources":["../../../src/video/effects/flash.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IACC;;;;;OAKG;IACH,sBALW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAA2B,KAAK;QACP,SAAS;KACpC,EAkBA;IAJA,kBAAyC;IAM1C;;;OAGG;IACH,oBAFW,MAAM,QAKhB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;CACD;yBA/EwB,mBAAmB"}
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
* Similar to OutlineEffect but with a soft, blurred edge instead of a hard line.
|
|
4
4
|
* Commonly used for power-ups, magic items, or selection highlights.
|
|
5
5
|
* @category Effects
|
|
6
|
-
* @see {@link Renderable
|
|
6
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
7
7
|
* @example
|
|
8
8
|
* // blue glow for a magic item
|
|
9
|
-
* mySprite.
|
|
9
|
+
* mySprite.addPostEffect(new GlowEffect(renderer, {
|
|
10
10
|
* color: [0.2, 0.5, 1.0],
|
|
11
11
|
* intensity: 1.5,
|
|
12
|
-
* });
|
|
12
|
+
* }));
|
|
13
13
|
*/
|
|
14
14
|
export default class GlowEffect extends ShaderEffect {
|
|
15
15
|
/**
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
17
17
|
* @param {object} [options] - effect options
|
|
18
18
|
* @param {number[]} [options.color=[1.0, 1.0, 1.0]] - glow color as [r, g, b] (0.0–1.0)
|
|
19
19
|
* @param {number} [options.width=3.0] - glow spread in pixels
|
|
20
20
|
* @param {number} [options.intensity=1.0] - glow brightness multiplier
|
|
21
21
|
* @param {number[]} [options.textureSize=[256, 256]] - texture dimensions [width, height]
|
|
22
22
|
*/
|
|
23
|
-
constructor(renderer:
|
|
23
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
24
24
|
color?: number[] | undefined;
|
|
25
25
|
width?: number | undefined;
|
|
26
26
|
intensity?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glow.d.ts","sourceRoot":"","sources":["../../../src/video/effects/glow.js"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;GAYG;AACH;IACC;;;;;;;OAOG;IACH,
|
|
1
|
+
{"version":3,"file":"glow.d.ts","sourceRoot":"","sources":["../../../src/video/effects/glow.js"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;GAYG;AACH;IACC;;;;;;;OAOG;IACH,sBAPW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAA2B,KAAK;QACP,KAAK;QACL,SAAS;QACP,WAAW;KACxC,EAsCA;IANA,kBAAyC;IAQ1C;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;IAED;;;OAGG;IACH,oBAFW,MAAM,QAKhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBAtHwB,mBAAmB"}
|
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
* Commonly used for sci-fi UI, ghost/spirit characters, or tech displays.
|
|
5
5
|
* The `time` uniform should be updated each frame for animation.
|
|
6
6
|
* @category Effects
|
|
7
|
-
* @see {@link Renderable
|
|
7
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
8
8
|
* @example
|
|
9
9
|
* const holo = new HologramEffect(renderer);
|
|
10
|
-
* mySprite.
|
|
10
|
+
* mySprite.addPostEffect(holo);
|
|
11
11
|
* // update each frame
|
|
12
12
|
* holo.setTime(performance.now() / 1000);
|
|
13
13
|
*/
|
|
14
14
|
export default class HologramEffect extends ShaderEffect {
|
|
15
15
|
/**
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
17
17
|
* @param {object} [options] - effect options
|
|
18
18
|
* @param {number[]} [options.color=[0.1, 0.7, 1.0]] - hologram tint color [r, g, b]
|
|
19
19
|
* @param {number} [options.intensity=0.5] - effect intensity (0.0–1.0)
|
|
20
20
|
*/
|
|
21
|
-
constructor(renderer:
|
|
21
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
22
22
|
color?: number[] | undefined;
|
|
23
23
|
intensity?: number | undefined;
|
|
24
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hologram.d.ts","sourceRoot":"","sources":["../../../src/video/effects/hologram.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;GAYG;AACH;IACC;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"hologram.d.ts","sourceRoot":"","sources":["../../../src/video/effects/hologram.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;GAYG;AACH;IACC;;;;;OAKG;IACH,sBALW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAA2B,KAAK;QACP,SAAS;KACpC,EAyBA;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;CACD;yBA7EwB,mBAAmB"}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
* A shader effect that inverts the colors of the sprite.
|
|
3
3
|
* Commonly used for damage feedback, negative image, or X-ray effects.
|
|
4
4
|
* @category Effects
|
|
5
|
-
* @see {@link Renderable
|
|
5
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
6
6
|
* @example
|
|
7
|
-
* mySprite.
|
|
7
|
+
* mySprite.addPostEffect(new InvertEffect(renderer));
|
|
8
8
|
* @example
|
|
9
9
|
* // partial inversion
|
|
10
|
-
* mySprite.
|
|
10
|
+
* mySprite.addPostEffect(new InvertEffect(renderer, { intensity: 0.5 }));
|
|
11
11
|
*/
|
|
12
12
|
export default class InvertEffect extends ColorMatrixEffect {
|
|
13
13
|
/**
|
|
14
|
-
* @param {
|
|
14
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
15
15
|
* @param {object} [options] - effect options
|
|
16
16
|
* @param {number} [options.intensity=1.0] - inversion intensity (0.0 = original, 1.0 = fully inverted)
|
|
17
17
|
*/
|
|
18
|
-
constructor(renderer:
|
|
18
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
19
19
|
intensity?: number | undefined;
|
|
20
20
|
});
|
|
21
21
|
intensity: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invert.d.ts","sourceRoot":"","sources":["../../../src/video/effects/invert.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH;IACC;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"invert.d.ts","sourceRoot":"","sources":["../../../src/video/effects/invert.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH;IACC;;;;OAIG;IACH,sBAJW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,SAAS;KACpC,EAMA;IAHA,kBACgE;IAIjE;;;OAGG;IACH,oBAFW,MAAM,QAKhB;CACD;8BAlC6B,kBAAkB"}
|
|
@@ -4,26 +4,26 @@
|
|
|
4
4
|
* current pixel is transparent, it draws the outline color.
|
|
5
5
|
* Commonly used for selection highlights, hover states, or collectible glow.
|
|
6
6
|
* @category Effects
|
|
7
|
-
* @see {@link Renderable
|
|
7
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
8
8
|
* @example
|
|
9
9
|
* // yellow outline for selection
|
|
10
|
-
* mySprite.
|
|
10
|
+
* mySprite.addPostEffect(new OutlineEffect(renderer, {
|
|
11
11
|
* color: [1.0, 1.0, 0.0],
|
|
12
12
|
* width: 2.0,
|
|
13
|
-
* });
|
|
13
|
+
* }));
|
|
14
14
|
* @example
|
|
15
15
|
* // remove the effect
|
|
16
|
-
* mySprite.
|
|
16
|
+
* mySprite.removePostEffect(outline);
|
|
17
17
|
*/
|
|
18
18
|
export default class OutlineEffect extends ShaderEffect {
|
|
19
19
|
/**
|
|
20
|
-
* @param {
|
|
20
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
21
21
|
* @param {object} [options] - effect options
|
|
22
22
|
* @param {number[]} [options.color=[1.0, 1.0, 1.0]] - outline color as [r, g, b] (0.0–1.0)
|
|
23
23
|
* @param {number} [options.width=1.0] - outline width in pixels
|
|
24
24
|
* @param {number[]} [options.textureSize] - texture dimensions [width, height] (defaults to renderer size)
|
|
25
25
|
*/
|
|
26
|
-
constructor(renderer:
|
|
26
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
27
27
|
color?: number[] | undefined;
|
|
28
28
|
width?: number | undefined;
|
|
29
29
|
textureSize?: number[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outline.d.ts","sourceRoot":"","sources":["../../../src/video/effects/outline.js"],"names":[],"mappings":"AAkCA;;;;;;;;;;;;;;;;GAgBG;AACH;IACC;;;;;;OAMG;IACH,
|
|
1
|
+
{"version":3,"file":"outline.d.ts","sourceRoot":"","sources":["../../../src/video/effects/outline.js"],"names":[],"mappings":"AAkCA;;;;;;;;;;;;;;;;GAgBG;AACH;IACC;;;;;;OAMG;IACH,sBANW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAA2B,KAAK;QACP,KAAK;QACH,WAAW;KACxC,EAsCA;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;IAED;;;OAGG;IACH,gBAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBA1HwB,mBAAmB"}
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
* A shader effect that pixelates the sprite by snapping UV coordinates
|
|
3
3
|
* to a grid. Commonly used for teleport effects, transitions, or retro styling.
|
|
4
4
|
* @category Effects
|
|
5
|
-
* @see {@link Renderable
|
|
5
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
6
6
|
* @example
|
|
7
7
|
* // moderate pixelation
|
|
8
|
-
* mySprite.
|
|
8
|
+
* mySprite.addPostEffect(new PixelateEffect(renderer, { size: 8.0 }));
|
|
9
9
|
* @example
|
|
10
10
|
* // animate the pixelation (e.g. for teleport)
|
|
11
11
|
* pixelate.setSize(pixelate.size + dt / 50);
|
|
12
12
|
*/
|
|
13
13
|
export default class PixelateEffect extends ShaderEffect {
|
|
14
14
|
/**
|
|
15
|
-
* @param {
|
|
15
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
16
16
|
* @param {object} [options] - effect options
|
|
17
17
|
* @param {number} [options.size=4.0] - pixel size in texels (higher = more pixelated)
|
|
18
18
|
* @param {number[]} [options.textureSize=[256, 256]] - texture dimensions [width, height]
|
|
19
19
|
*/
|
|
20
|
-
constructor(renderer:
|
|
20
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
21
21
|
size?: number | undefined;
|
|
22
22
|
textureSize?: number[] | undefined;
|
|
23
23
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixelate.d.ts","sourceRoot":"","sources":["../../../src/video/effects/pixelate.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;GAWG;AACH;IACC;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"pixelate.d.ts","sourceRoot":"","sources":["../../../src/video/effects/pixelate.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;GAWG;AACH;IACC;;;;;OAKG;IACH,sBALW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,IAAI;QACF,WAAW;KACxC,EAoBA;IALA,aAA+B;IAOhC;;;OAGG;IACH,cAFW,MAAM,QAKhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBA3EwB,mBAAmB"}
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
* // Pickup highlight — attach to any Renderable so it renders inside
|
|
53
53
|
* // the renderable's bounding rect (anchorPoint applies). Combine with
|
|
54
54
|
* // `blendMode = "lighter"` for the additive glow look.
|
|
55
|
-
* pickup.
|
|
55
|
+
* pickup.addPostEffect(new RadialGradientEffect(renderer, {
|
|
56
56
|
* color: new Color(120, 255, 200), // mint green
|
|
57
57
|
* intensity: 0.8,
|
|
58
|
-
* });
|
|
58
|
+
* }));
|
|
59
59
|
* pickup.blendMode = "lighter";
|
|
60
60
|
* @example
|
|
61
61
|
* // Damage / impact indicator — short-lived elliptical flash on hit.
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
* A shader effect that overlays horizontal scanlines on the sprite.
|
|
3
3
|
* Can optionally add barrel distortion and vignette for a full CRT monitor look.
|
|
4
4
|
* @category Effects
|
|
5
|
-
* @see {@link Renderable
|
|
5
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
6
6
|
* @example
|
|
7
7
|
* // simple scanlines
|
|
8
|
-
* mySprite.
|
|
8
|
+
* mySprite.addPostEffect(new ScanlineEffect(renderer, { opacity: 0.3 }));
|
|
9
9
|
* @example
|
|
10
10
|
* // full CRT look with curvature and vignette
|
|
11
|
-
* mySprite.
|
|
11
|
+
* mySprite.addPostEffect(new ScanlineEffect(renderer, {
|
|
12
12
|
* opacity: 0.3,
|
|
13
13
|
* curvature: 0.02,
|
|
14
14
|
* vignetteStrength: 0.3,
|
|
15
|
-
* });
|
|
15
|
+
* }));
|
|
16
16
|
*/
|
|
17
17
|
export default class ScanlineEffect extends ShaderEffect {
|
|
18
18
|
/**
|
|
19
|
-
* @param {
|
|
19
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
20
20
|
* @param {object} [options] - effect options
|
|
21
21
|
* @param {number} [options.opacity=0.25] - scanline darkness (0.0 = invisible, 1.0 = fully black lines)
|
|
22
22
|
* @param {number} [options.curvature=0.0] - barrel distortion strength (0.0 = flat, 0.02 = subtle CRT curve)
|
|
23
23
|
* @param {number} [options.vignetteStrength=0.0] - edge darkening strength (0.0 = none, 0.3 = subtle)
|
|
24
24
|
*/
|
|
25
|
-
constructor(renderer:
|
|
25
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
26
26
|
opacity?: number | undefined;
|
|
27
27
|
curvature?: number | undefined;
|
|
28
28
|
vignetteStrength?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanline.d.ts","sourceRoot":"","sources":["../../../src/video/effects/scanline.js"],"names":[],"mappings":"AA0CA;;;;;;;;;;;;;;;GAeG;AACH;IACC;;;;;;OAMG;IACH,
|
|
1
|
+
{"version":3,"file":"scanline.d.ts","sourceRoot":"","sources":["../../../src/video/effects/scanline.js"],"names":[],"mappings":"AA0CA;;;;;;;;;;;;;;;GAeG;AACH;IACC;;;;;;OAMG;IACH,sBANW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,OAAO;QACP,SAAS;QACT,gBAAgB;KAC3C,EAyCA;IAED;;;OAGG;IACH,oBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,wBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,8BAFW,MAAM,QAIhB;CACD;yBAnIwB,mBAAmB"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A shader effect that applies a warm sepia (vintage photo) tone to the sprite.
|
|
3
3
|
* @category Effects
|
|
4
|
-
* @see {@link Renderable
|
|
4
|
+
* @see {@link Renderable#addPostEffect} for usage
|
|
5
5
|
* @example
|
|
6
|
-
* mySprite.
|
|
6
|
+
* mySprite.addPostEffect(new SepiaEffect(renderer));
|
|
7
7
|
* @example
|
|
8
8
|
* // partial sepia
|
|
9
|
-
* mySprite.
|
|
9
|
+
* mySprite.addPostEffect(new SepiaEffect(renderer, { intensity: 0.5 }));
|
|
10
10
|
*/
|
|
11
11
|
export default class SepiaEffect extends ColorMatrixEffect {
|
|
12
12
|
/**
|
|
13
|
-
* @param {
|
|
13
|
+
* @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
|
|
14
14
|
* @param {object} [options] - effect options
|
|
15
15
|
* @param {number} [options.intensity=1.0] - sepia intensity (0.0 = original, 1.0 = full sepia)
|
|
16
16
|
*/
|
|
17
|
-
constructor(renderer:
|
|
17
|
+
constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
|
|
18
18
|
intensity?: number | undefined;
|
|
19
19
|
});
|
|
20
20
|
intensity: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sepia.d.ts","sourceRoot":"","sources":["../../../src/video/effects/sepia.js"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH;IACC;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"sepia.d.ts","sourceRoot":"","sources":["../../../src/video/effects/sepia.js"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH;IACC;;;;OAIG;IACH,sBAJW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,SAAS;KACpC,EAMA;IAHA,kBACgE;IAIjE;;;OAGG;IACH,oBAFW,MAAM,QAKhB;CACD;8BAjC6B,kBAAkB"}
|