melonjs 19.0.0 → 19.2.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 +7 -5
- package/build/application/application.d.ts +33 -0
- package/build/application/application.d.ts.map +1 -1
- package/build/application/defaultApplicationSettings.d.ts +1 -0
- package/build/application/defaultApplicationSettings.d.ts.map +1 -1
- package/build/application/settings.d.ts +47 -1
- package/build/application/settings.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts +45 -22
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/effects/camera_effect.d.ts +45 -0
- package/build/camera/effects/camera_effect.d.ts.map +1 -0
- package/build/camera/effects/fade_effect.d.ts +60 -0
- package/build/camera/effects/fade_effect.d.ts.map +1 -0
- package/build/camera/effects/mask_effect.d.ts +88 -0
- package/build/camera/effects/mask_effect.d.ts.map +1 -0
- package/build/camera/effects/shake_effect.d.ts +47 -0
- package/build/camera/effects/shake_effect.d.ts.map +1 -0
- package/build/index.d.ts +10 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2928 -935
- package/build/index.js.map +4 -4
- package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
- package/build/math/color_matrix.d.ts +51 -0
- package/build/math/color_matrix.d.ts.map +1 -0
- package/build/math/matrix2d.d.ts +6 -6
- package/build/math/matrix3d.d.ts +17 -0
- package/build/math/matrix3d.d.ts.map +1 -1
- package/build/particles/emitter.d.ts +19 -5
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +4 -1
- package/build/particles/particle.d.ts.map +1 -1
- package/build/particles/settings.d.ts +200 -31
- package/build/particles/settings.d.ts.map +1 -1
- package/build/physics/quadtree.d.ts.map +1 -1
- package/build/renderable/imagelayer.d.ts +13 -2
- package/build/renderable/imagelayer.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +54 -35
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +33 -5
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts +27 -1
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/trigger.d.ts +44 -19
- package/build/renderable/trigger.d.ts.map +1 -1
- package/build/state/state.d.ts +44 -2
- package/build/state/state.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +9 -0
- package/build/tweens/tween.d.ts.map +1 -1
- package/build/video/buffer/index.d.ts +40 -0
- package/build/video/buffer/index.d.ts.map +1 -0
- package/build/video/{webgl/buffer → buffer}/vertex.d.ts +11 -4
- package/build/video/buffer/vertex.d.ts.map +1 -0
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/renderer.d.ts +79 -0
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/renderstate.d.ts +7 -0
- package/build/video/renderstate.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +26 -63
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/render_target_pool.d.ts +73 -0
- package/build/video/rendertarget/render_target_pool.d.ts.map +1 -0
- package/build/video/rendertarget/rendertarget.d.ts +77 -0
- package/build/video/rendertarget/rendertarget.d.ts.map +1 -0
- package/build/video/rendertarget/webglrendertarget.d.ts +30 -0
- package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -0
- package/build/video/texture/cache.d.ts +6 -0
- package/build/video/texture/cache.d.ts.map +1 -1
- package/build/video/webgl/batchers/batcher.d.ts +4 -4
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts +3 -3
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts +34 -0
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/buffer/index.d.ts +5 -34
- package/build/video/webgl/buffer/index.d.ts.map +1 -1
- package/build/video/webgl/effects/colorMatrix.d.ts +92 -0
- package/build/video/webgl/effects/colorMatrix.d.ts.map +1 -0
- package/build/video/webgl/effects/desaturate.d.ts +2 -4
- package/build/video/webgl/effects/desaturate.d.ts.map +1 -1
- package/build/video/webgl/effects/invert.d.ts +2 -2
- package/build/video/webgl/effects/invert.d.ts.map +1 -1
- package/build/video/webgl/effects/sepia.d.ts +2 -2
- package/build/video/webgl/effects/sepia.d.ts.map +1 -1
- package/build/video/webgl/effects/vignette.d.ts +42 -0
- package/build/video/webgl/effects/vignette.d.ts.map +1 -0
- package/build/video/webgl/shadereffect.d.ts.map +1 -1
- package/build/video/webgl/shaders/multitexture.d.ts +10 -0
- package/build/video/webgl/shaders/multitexture.d.ts.map +1 -0
- package/build/video/webgl/utils/precision.d.ts +4 -3
- package/build/video/webgl/utils/precision.d.ts.map +1 -1
- package/build/video/webgl/webgl_renderer.d.ts +15 -8
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/package.json +1 -1
- package/build/video/webgl/buffer/vertex.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXObjectFactory.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXObjectFactory.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TMXObjectFactory.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXObjectFactory.js"],"names":[],"mappings":"AA2BA;;;;;;GAMG;AACH,0CAJW,MAAM,GACJ,OAAO,GAAC,MAAM,EAAE,CAY5B;AAED;;;;;;;;;;;;GAYG;AACH,2CAJW,MAAM,GACJ,MAAM,CAsBlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,iDApBW,MAAM,2BAgChB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,+CAZW,MAAM,+BA6BhB;AAQD;;;;;;;GAOG;AACH,gDAJW,MAAM,+BAWhB;AAoCD;;;;;;;GAOG;AACH,0CALW,MAAM,OACN,UAAU,GACR,UAAU,CAqBtB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Matrix3d } from "./matrix3d.ts";
|
|
2
|
+
/**
|
|
3
|
+
* A 4x4 color transformation matrix extending {@link Matrix3d}.
|
|
4
|
+
* Provides chainable methods for common color adjustments.
|
|
5
|
+
* @category Math
|
|
6
|
+
* @example
|
|
7
|
+
* // grayscale
|
|
8
|
+
* const cm = new ColorMatrix().saturate(0.0);
|
|
9
|
+
* @example
|
|
10
|
+
* // combine brightness + contrast
|
|
11
|
+
* const cm = new ColorMatrix().brightness(1.3).contrast(1.5);
|
|
12
|
+
*/
|
|
13
|
+
export declare class ColorMatrix extends Matrix3d {
|
|
14
|
+
/**
|
|
15
|
+
* Apply a brightness adjustment.
|
|
16
|
+
* @param amount - brightness multiplier (1.0 = normal, >1 brighter, <1 darker)
|
|
17
|
+
* @returns this instance for chaining
|
|
18
|
+
*/
|
|
19
|
+
brightness(amount: number): this;
|
|
20
|
+
/**
|
|
21
|
+
* Apply a contrast adjustment.
|
|
22
|
+
* @param amount - contrast multiplier (1.0 = normal, >1 more contrast, <1 less)
|
|
23
|
+
* @returns this instance for chaining
|
|
24
|
+
*/
|
|
25
|
+
contrast(amount: number): this;
|
|
26
|
+
/**
|
|
27
|
+
* Apply a saturation adjustment.
|
|
28
|
+
* @param amount - saturation level (0.0 = grayscale, 1.0 = normal, >1 over-saturated)
|
|
29
|
+
* @returns this instance for chaining
|
|
30
|
+
*/
|
|
31
|
+
saturate(amount: number): this;
|
|
32
|
+
/**
|
|
33
|
+
* Apply a hue rotation.
|
|
34
|
+
* @param angle - rotation angle in radians
|
|
35
|
+
* @returns this instance for chaining
|
|
36
|
+
*/
|
|
37
|
+
hueRotate(angle: number): this;
|
|
38
|
+
/**
|
|
39
|
+
* Apply a sepia tone.
|
|
40
|
+
* @param amount - sepia intensity (0.0 = original, 1.0 = full sepia)
|
|
41
|
+
* @returns this instance for chaining
|
|
42
|
+
*/
|
|
43
|
+
sepia(amount?: number): this;
|
|
44
|
+
/**
|
|
45
|
+
* Apply a color inversion.
|
|
46
|
+
* @param amount - inversion amount (0.0 = original, 1.0 = fully inverted)
|
|
47
|
+
* @returns this instance for chaining
|
|
48
|
+
*/
|
|
49
|
+
invertColors(amount?: number): this;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=color_matrix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_matrix.d.ts","sourceRoot":"","sources":["../../src/math/color_matrix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,qBAAa,WAAY,SAAQ,QAAQ;IACxC;;;;OAIG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAqBhC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAsB9B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAwB9B;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IA0B9B;;;;OAIG;IACH,KAAK,CAAC,MAAM,GAAE,MAAY,GAAG,IAAI;IA2CjC;;;;OAIG;IACH,YAAY,CAAC,MAAM,GAAE,MAAY,GAAG,IAAI;CAqBxC"}
|
package/build/math/matrix2d.d.ts
CHANGED
|
@@ -44,12 +44,12 @@ export declare class Matrix2d {
|
|
|
44
44
|
setTransform(...values: [number, number, number, number, number, number] | [number, number, number, number, number, number, number, number, number]): this;
|
|
45
45
|
/**
|
|
46
46
|
* Multiplies the current transformation with the matrix described by the arguments of this method.
|
|
47
|
-
* @param a a component
|
|
48
|
-
* @param b b component
|
|
49
|
-
* @param c c component
|
|
50
|
-
* @param d d component
|
|
51
|
-
* @param e e component
|
|
52
|
-
* @param f f component
|
|
47
|
+
* @param a - a component (scale x / cos)
|
|
48
|
+
* @param b - b component (skew y / sin)
|
|
49
|
+
* @param c - c component (skew x / -sin)
|
|
50
|
+
* @param d - d component (scale y / cos)
|
|
51
|
+
* @param e - e component (translate x)
|
|
52
|
+
* @param f - f component (translate y)
|
|
53
53
|
* @returns Reference to this object for method chaining
|
|
54
54
|
*/
|
|
55
55
|
transform(a: number, b: number, c: number, d: number, e: number, f: number): this;
|
package/build/math/matrix3d.d.ts
CHANGED
|
@@ -81,6 +81,23 @@ export declare class Matrix3d {
|
|
|
81
81
|
* @returns Reference to this object for method chaining
|
|
82
82
|
*/
|
|
83
83
|
multiply(m: Matrix3d | Matrix2d): this;
|
|
84
|
+
/**
|
|
85
|
+
* Multiplies the current transformation with a 2D affine matrix (a, b, c, d, e, f).
|
|
86
|
+
* The 2D matrix is promoted to 4x4 internally.
|
|
87
|
+
* @param a - a component (scale x / cos)
|
|
88
|
+
* @param b - b component (skew y / sin)
|
|
89
|
+
* @param c - c component (skew x / -sin)
|
|
90
|
+
* @param d - d component (scale y / cos)
|
|
91
|
+
* @param e - e component (translate x)
|
|
92
|
+
* @param f - f component (translate y)
|
|
93
|
+
* @returns Reference to this object for method chaining
|
|
94
|
+
*/
|
|
95
|
+
transform(a: number, b: number, c: number, d: number, e: number, f: number): this;
|
|
96
|
+
/**
|
|
97
|
+
* Multiplies the current transformation with a full 4x4 matrix specified as 16 individual values (column-major).
|
|
98
|
+
* @returns Reference to this object for method chaining
|
|
99
|
+
*/
|
|
100
|
+
transform(b00: number, b01: number, b02: number, b03: number, b10: number, b11: number, b12: number, b13: number, b20: number, b21: number, b22: number, b23: number, b30: number, b31: number, b32: number, b33: number): this;
|
|
84
101
|
/**
|
|
85
102
|
* Transpose the value of this matrix.
|
|
86
103
|
* @returns Reference to this object for method chaining
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix3d.d.ts","sourceRoot":"","sources":["../../src/math/matrix3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACz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M,CAAC,CAAC,EAAE,QAAQ;IAwBlB;;;;OAIG;IACH,UAAU,CAAC,GAAG,CAAC,EAAE,QAAQ;IAOzB;;;OAGG;IACH,KAAK;IAIL;;;OAGG;IACH,OAAO;IAIP;;;OAGG;IACH,QAAQ;CASR;AAED,eAAO,MAAM,YAAY,4DAWxB,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import Container from "./../renderable/container.js";
|
|
2
2
|
import CanvasRenderTarget from "../video/rendertarget/canvasrendertarget.js";
|
|
3
|
+
import { type ParticleEmitterSettings } from "./settings.ts";
|
|
3
4
|
/**
|
|
4
5
|
* Particle Emitter Object.
|
|
5
6
|
* @category Particles
|
|
6
7
|
*/
|
|
7
8
|
export default class ParticleEmitter extends Container {
|
|
8
9
|
/**
|
|
9
|
-
* the current (active) emitter settings
|
|
10
|
+
* the current (active) emitter settings (with defaults merged in)
|
|
10
11
|
*/
|
|
11
|
-
settings:
|
|
12
|
+
settings: ParticleEmitterSettings;
|
|
12
13
|
/** @ignore */
|
|
13
14
|
_stream: boolean;
|
|
14
15
|
/** @ignore */
|
|
@@ -23,6 +24,19 @@ export default class ParticleEmitter extends Container {
|
|
|
23
24
|
_dt: number;
|
|
24
25
|
/** @ignore */
|
|
25
26
|
_defaultParticle: CanvasRenderTarget | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* whether at least one particle has been spawned by this emitter — used as
|
|
29
|
+
* the precondition for completion detection (a brand-new emitter with zero
|
|
30
|
+
* children must not count as "complete")
|
|
31
|
+
* @ignore
|
|
32
|
+
*/
|
|
33
|
+
_hasSpawned: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* cached `timer.maxfps / 1000` — particles read this directly instead of
|
|
36
|
+
* recomputing it on every spawn.
|
|
37
|
+
* @ignore
|
|
38
|
+
*/
|
|
39
|
+
_deltaInv: number;
|
|
26
40
|
/**
|
|
27
41
|
* @param x - x position of the particle emitter
|
|
28
42
|
* @param y - y position of the particle emitter
|
|
@@ -53,12 +67,12 @@ export default class ParticleEmitter extends Container {
|
|
|
53
67
|
* // call this in onDestroyEvent function
|
|
54
68
|
* app.world.removeChild(emitter);
|
|
55
69
|
*/
|
|
56
|
-
constructor(x: number, y: number, settings?:
|
|
70
|
+
constructor(x: number, y: number, settings?: Partial<ParticleEmitterSettings>);
|
|
57
71
|
/**
|
|
58
72
|
* Reset the emitter with particle emitter settings.
|
|
59
|
-
* @param settings -
|
|
73
|
+
* @param settings - object with emitter settings. See {@link ParticleEmitterSettings}
|
|
60
74
|
*/
|
|
61
|
-
reset(settings?:
|
|
75
|
+
reset(settings?: Partial<ParticleEmitterSettings>): void;
|
|
62
76
|
/**
|
|
63
77
|
* returns a random point on the x axis within the bounds of this emitter
|
|
64
78
|
* @returns a random x position within the emitter bounds
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/particles/emitter.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/particles/emitter.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,8BAA8B,CAAC;AAErD,OAAO,kBAAkB,MAAM,6CAA6C,CAAC;AAE7E,OAA+B,EAC9B,KAAK,uBAAuB,EAC5B,MAAM,eAAe,CAAC;AAmCvB;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAS;IACrD;;OAEG;IACH,QAAQ,EAAE,uBAAuB,CAAC;IAElC,cAAc;IACd,OAAO,EAAE,OAAO,CAAC;IAEjB,cAAc;IACd,eAAe,EAAE,MAAM,CAAC;IAExB,cAAc;IACd,cAAc,EAAE,MAAM,CAAC;IAEvB,cAAc;IACd,QAAQ,EAAE,OAAO,CAAC;IAElB,cAAc;IACd,YAAY,EAAE,MAAM,CAAC;IAErB,cAAc;IACd,GAAG,EAAE,MAAM,CAAC;IAEZ,cAAc;IACd,gBAAgB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAEjD;;;;;OAKG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;gBAEF,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,GAAE,OAAO,CAAC,uBAAuB,CAAM;IAoChD;;;OAGG;IACM,KAAK,CAAC,QAAQ,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAAG,IAAI;IAqCrE;;;OAGG;IACH,eAAe,IAAI,MAAM;IAIzB;;;OAGG;IACH,eAAe,IAAI,MAAM;IAKzB,cAAc;IACd,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAcjC;;;OAGG;IACH,SAAS,IAAI,OAAO;IAIpB;;;OAGG;IACH,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAQxC;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;;OAGG;IACH,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IASpC;;OAEG;IACM,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAoEpC;;;OAGG;IACM,OAAO,IAAI,IAAI;CASxB"}
|
|
@@ -9,7 +9,7 @@ import ParticleEmitter from "./emitter.ts";
|
|
|
9
9
|
*/
|
|
10
10
|
export default class Particle extends Renderable {
|
|
11
11
|
vel: Vector2d;
|
|
12
|
-
image:
|
|
12
|
+
image: HTMLCanvasElement | HTMLImageElement;
|
|
13
13
|
life: number;
|
|
14
14
|
startLife: number;
|
|
15
15
|
startScale: number;
|
|
@@ -18,7 +18,10 @@ export default class Particle extends Renderable {
|
|
|
18
18
|
wind: number;
|
|
19
19
|
followTrajectory: boolean;
|
|
20
20
|
onlyInViewport: boolean;
|
|
21
|
+
accurateBounds: boolean;
|
|
21
22
|
_deltaInv: number;
|
|
23
|
+
_halfW: number;
|
|
24
|
+
_halfH: number;
|
|
22
25
|
_angle: number;
|
|
23
26
|
alive: boolean;
|
|
24
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"particle.d.ts","sourceRoot":"","sources":["../../src/particles/particle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAgB,MAAM,qBAAqB,CAAC;AAG7D,OAAO,UAAU,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"particle.d.ts","sourceRoot":"","sources":["../../src/particles/particle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAgB,MAAM,qBAAqB,CAAC;AAG7D,OAAO,UAAU,MAAM,6BAA6B,CAAC;AAErD,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAChE,OAAO,aAAa,MAAM,kCAAkC,CAAC;AAC7D,OAAO,eAAe,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;IAC/C,GAAG,EAAE,QAAQ,CAAC;IACd,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IAEf;;OAEG;gBACS,OAAO,EAAE,eAAe;IAiBpC;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,WAAW,GAAE,OAAe;IAwFnE;;;;;OAKG;IACM,MAAM,CAAC,EAAE,EAAE,MAAM;IAuF1B;;OAEG;IACM,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,aAAa;CAMtD;AAED,eAAO,MAAM,YAAY,wEAWxB,CAAC"}
|
|
@@ -1,33 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import type ParticleEmitter from "./emitter.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration shape for {@link ParticleEmitter}.
|
|
4
|
+
* Every field has a sensible default; users typically pass a `Partial<ParticleEmitterSettings>`
|
|
5
|
+
* to the constructor or {@link ParticleEmitter#reset}.
|
|
6
|
+
* @category Particles
|
|
7
|
+
* @see {@link ParticleEmitter}
|
|
8
|
+
*/
|
|
9
|
+
export interface ParticleEmitterSettings {
|
|
10
|
+
/**
|
|
11
|
+
* Width of the particle spawn area.
|
|
12
|
+
* @default 1
|
|
13
|
+
*/
|
|
14
|
+
width: number;
|
|
15
|
+
/**
|
|
16
|
+
* Height of the particle spawn area.
|
|
17
|
+
* @default 1
|
|
18
|
+
*/
|
|
19
|
+
height: number;
|
|
20
|
+
/**
|
|
21
|
+
* Image used for particles texture (by default melonJS will create a white
|
|
22
|
+
* 8x8 texture image).
|
|
23
|
+
* @default undefined
|
|
24
|
+
* @see {@link textureSize}
|
|
25
|
+
*/
|
|
26
|
+
image: HTMLCanvasElement | HTMLImageElement | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Default texture size used for particles if no image is specified
|
|
29
|
+
* (by default melonJS will create a white 8x8 texture image).
|
|
30
|
+
* @default 8
|
|
31
|
+
* @see {@link image}
|
|
32
|
+
*/
|
|
33
|
+
textureSize: number;
|
|
34
|
+
/**
|
|
35
|
+
* Tint to be applied to particles.
|
|
36
|
+
* @default "#fff"
|
|
37
|
+
*/
|
|
38
|
+
tint: string;
|
|
39
|
+
/**
|
|
40
|
+
* Total number of particles in the emitter.
|
|
41
|
+
* @default 50
|
|
42
|
+
*/
|
|
43
|
+
totalParticles: number;
|
|
44
|
+
/**
|
|
45
|
+
* Start angle for particle launch in Radians.
|
|
46
|
+
* @default Math.PI / 2
|
|
47
|
+
*/
|
|
48
|
+
angle: number;
|
|
49
|
+
/**
|
|
50
|
+
* Variation in the start angle for particle launch in Radians.
|
|
51
|
+
* @default 0
|
|
52
|
+
*/
|
|
53
|
+
angleVariation: number;
|
|
54
|
+
/**
|
|
55
|
+
* Minimum time each particle lives once it is emitted in ms.
|
|
56
|
+
* If greater than `maxLife`, it is clamped to `maxLife` at reset.
|
|
57
|
+
* @default 1000
|
|
58
|
+
*/
|
|
59
|
+
minLife: number;
|
|
60
|
+
/**
|
|
61
|
+
* Maximum time each particle lives once it is emitted in ms.
|
|
62
|
+
* @default 3000
|
|
63
|
+
*/
|
|
64
|
+
maxLife: number;
|
|
65
|
+
/**
|
|
66
|
+
* Start speed of particles.
|
|
67
|
+
* @default 2
|
|
68
|
+
*/
|
|
69
|
+
speed: number;
|
|
70
|
+
/**
|
|
71
|
+
* Variation in the start speed of particles.
|
|
72
|
+
* @default 1
|
|
73
|
+
*/
|
|
74
|
+
speedVariation: number;
|
|
75
|
+
/**
|
|
76
|
+
* Minimum start rotation for particle sprites in Radians.
|
|
77
|
+
* @default 0
|
|
78
|
+
*/
|
|
79
|
+
minRotation: number;
|
|
80
|
+
/**
|
|
81
|
+
* Maximum start rotation for particle sprites in Radians.
|
|
82
|
+
* @default 0
|
|
83
|
+
*/
|
|
84
|
+
maxRotation: number;
|
|
85
|
+
/**
|
|
86
|
+
* Minimum start scale ratio for particles (1 = no scaling).
|
|
87
|
+
* @default 1
|
|
88
|
+
*/
|
|
89
|
+
minStartScale: number;
|
|
90
|
+
/**
|
|
91
|
+
* Maximum start scale ratio for particles (1 = no scaling).
|
|
92
|
+
* @default 1
|
|
93
|
+
*/
|
|
94
|
+
maxStartScale: number;
|
|
95
|
+
/**
|
|
96
|
+
* Minimum end scale ratio for particles.
|
|
97
|
+
* @default 0
|
|
98
|
+
*/
|
|
99
|
+
minEndScale: number;
|
|
100
|
+
/**
|
|
101
|
+
* Maximum end scale ratio for particles.
|
|
102
|
+
* @default 0
|
|
103
|
+
*/
|
|
104
|
+
maxEndScale: number;
|
|
105
|
+
/**
|
|
106
|
+
* Vertical force (Gravity) for each particle.
|
|
107
|
+
* @default 0
|
|
108
|
+
* @see {@link World.gravity}
|
|
109
|
+
*/
|
|
110
|
+
gravity: number;
|
|
111
|
+
/**
|
|
112
|
+
* Horizontal force (like a Wind) for each particle.
|
|
113
|
+
* @default 0
|
|
114
|
+
*/
|
|
115
|
+
wind: number;
|
|
116
|
+
/**
|
|
117
|
+
* Update the rotation of particle in accordance with the particle trajectory.
|
|
118
|
+
* The particle sprite should aim at zero angle (draw from left to right).
|
|
119
|
+
* Overrides the particle `minRotation` and `maxRotation`.
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
followTrajectory: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Enable the Texture Additive by composite operation ("additive" blendMode).
|
|
125
|
+
* @default false
|
|
126
|
+
* @see {@link blendMode}
|
|
127
|
+
*/
|
|
128
|
+
textureAdditive: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Blend mode applied when rendering particles. If different than "normal",
|
|
131
|
+
* supersedes the `textureAdditive` setting.
|
|
132
|
+
* @default "normal"
|
|
133
|
+
* @see {@link CanvasRenderer#setBlendMode}
|
|
134
|
+
* @see {@link WebGLRenderer#setBlendMode}
|
|
135
|
+
*/
|
|
136
|
+
blendMode: string;
|
|
137
|
+
/**
|
|
138
|
+
* Update particles only in the viewport; remove when out of viewport.
|
|
139
|
+
* @default true
|
|
140
|
+
*/
|
|
141
|
+
onlyInViewport: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Render particles in screen space.
|
|
144
|
+
* @default false
|
|
145
|
+
*/
|
|
146
|
+
floating: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Maximum number of particles launched each tick (stream mode only).
|
|
149
|
+
* @default 10
|
|
150
|
+
*/
|
|
151
|
+
maxParticles: number;
|
|
152
|
+
/**
|
|
153
|
+
* How often a particle is emitted in ms (stream mode only).
|
|
154
|
+
* @default 100
|
|
155
|
+
*/
|
|
156
|
+
frequency: number;
|
|
157
|
+
/**
|
|
158
|
+
* Duration that the emitter releases particles in ms (stream mode only).
|
|
159
|
+
* After this period, the emitter stops launching particles.
|
|
160
|
+
* @default Infinity
|
|
161
|
+
*/
|
|
162
|
+
duration: number;
|
|
163
|
+
/**
|
|
164
|
+
* Skip n frames after updating the particle system once.
|
|
165
|
+
* Reduces the performance impact of emitters with many particles.
|
|
166
|
+
* @default 0
|
|
167
|
+
*/
|
|
168
|
+
framesToSkip: number;
|
|
169
|
+
/**
|
|
170
|
+
* When `true`, each particle refreshes its bounding box every frame so the
|
|
171
|
+
* hitbox tracks the visual exactly (useful for debug visualization or
|
|
172
|
+
* collision queries). When `false` (default), bounds reflect the previous
|
|
173
|
+
* frame's transform — sufficient for viewport culling and significantly
|
|
174
|
+
* cheaper at high particle counts.
|
|
175
|
+
* @default false
|
|
176
|
+
*/
|
|
177
|
+
accurateBounds: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* When `true`, the emitter automatically removes itself from its parent
|
|
180
|
+
* container once all particles have died. Useful for fire-and-forget
|
|
181
|
+
* `burstParticles()` use cases (explosions, pickups, impact effects) where
|
|
182
|
+
* there is no natural cleanup hook.
|
|
183
|
+
* @default false
|
|
184
|
+
*/
|
|
185
|
+
autoDestroyOnComplete: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Optional callback fired when the emitter completes (all particles dead
|
|
188
|
+
* after at least one particle has been spawned, and — for stream mode —
|
|
189
|
+
* the duration has elapsed). Fires regardless of `autoDestroyOnComplete`,
|
|
190
|
+
* and runs *before* the emitter is removed from its parent. The callback
|
|
191
|
+
* is invoked with the emitter as its `this` context.
|
|
192
|
+
* @default undefined
|
|
193
|
+
*/
|
|
194
|
+
onComplete: ((this: ParticleEmitter) => void) | undefined;
|
|
32
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* Default values for every {@link ParticleEmitterSettings} field.
|
|
198
|
+
* @category Particles
|
|
199
|
+
*/
|
|
200
|
+
declare const defaultParticleEmitterSettings: ParticleEmitterSettings;
|
|
201
|
+
export default defaultParticleEmitterSettings;
|
|
33
202
|
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/particles/settings.
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/particles/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,cAAc,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAExD;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,OAAO,EAAE,M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1
|
-
{"version":3,"file":"quadtree.d.ts","sourceRoot":"","sources":["../../src/physics/quadtree.js"],"names":[],"mappings":"AA2DA;;;;GAIG;AACH;IACC;;;;;;OAMG;IACH,mBANW,KAAK,UACL,MAAM,gBACN,MAAM,eACN,MAAM,UACN,MAAM,EAahB;IAVA,aAAkB;IAClB,eAAoB;IAEpB,oBAA8B;IAC9B,mBAA4B;IAE5B,cAAkB;IAElB,eAAiB;IACjB,aAAe;IAMhB,cA8DC;IAOD,4BA+CC;IAED;;;OAGG;IACH,2BAFW,SAAS,
|
|
1
|
+
{"version":3,"file":"quadtree.d.ts","sourceRoot":"","sources":["../../src/physics/quadtree.js"],"names":[],"mappings":"AA2DA;;;;GAIG;AACH;IACC;;;;;;OAMG;IACH,mBANW,KAAK,UACL,MAAM,gBACN,MAAM,eACN,MAAM,UACN,MAAM,EAahB;IAVA,aAAkB;IAClB,eAAoB;IAEpB,oBAA8B;IAC9B,mBAA4B;IAE5B,cAAkB;IAElB,eAAiB;IACjB,aAAe;IAMhB,cA8DC;IAOD,4BA+CC;IAED;;;OAGG;IACH,2BAFW,SAAS,QAyBnB;IAED;;;;;OAKG;IACH,aAFW,MAAM,QAoChB;IAED;;;;;OAKG;IACH,eAJW,MAAM,OACN,MAAM,gBACJ,MAAM,EAAE,CAmCpB;IAED;;;;;OAKG;IACH,aAHW,MAAM,GACJ,OAAO,CAkCnB;IAED;;;OAGG;IACH,cAFa,OAAO,CAInB;IAED;;;OAGG;IACH,eAFa,OAAO,CAUnB;IAED;;;OAGG;IACH,eAFW,MAAM,QAsBhB;CACD;uBAlZqB,YAAY;4BAET,aAAa;2BADZ,8BAA8B"}
|
|
@@ -78,8 +78,19 @@ export default class ImageLayer extends Sprite {
|
|
|
78
78
|
*/
|
|
79
79
|
updateLayer(): void;
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
81
|
+
* Override the default preDraw to skip the base class's anchor offset
|
|
82
|
+
* translation and `autoTransform` application — `ImageLayer.draw()`
|
|
83
|
+
* computes its own world-space position from the viewport, the parallax
|
|
84
|
+
* `ratio`, anchor, and zoom, so applying anchor/transform here would
|
|
85
|
+
* double-translate the layer.
|
|
86
|
+
*
|
|
87
|
+
* Coordinate-sensitive setup (flip, stencil mask) is intentionally
|
|
88
|
+
* deferred to `draw()` where it runs *after* the per-camera zoom
|
|
89
|
+
* translate/scale — that way it stays correctly aligned at any
|
|
90
|
+
* `viewport.zoom` and across multiple cameras. Coordinate-independent
|
|
91
|
+
* setup (alpha, post-effects, tint, blend) stays here. The inherited
|
|
92
|
+
* `Renderable.postDraw` cleans up symmetrically (`clearTint` /
|
|
93
|
+
* `clearMask` / `endPostEffect` / `restore`).
|
|
83
94
|
* @ignore
|
|
84
95
|
*/
|
|
85
96
|
preDraw(renderer: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imagelayer.d.ts","sourceRoot":"","sources":["../../src/renderable/imagelayer.js"],"names":[],"mappings":"AAYA;;;GAGG;AAEH;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;OAgBG;IACH,eAhBW,MAAM,KACN,MAAM,YAEd;QAA4E,KAAK,EAAzE,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,MAAM;QACvC,IAAI;QACJ,CAAC;QACQ,KAAK;QACsB,MAAM;QACjC,WAAW;KAC9C,EAoDF;IAhCA;;;;;;;;;OASG;IACH,OAHU,QAAQ,CAGqB;IAuCxC,kBAPU,MAAM,EA2Bf;IAnCD;;;;;;;;;;OAUG;IACH,cAHU,MAAM,CAKf;IAGA,4BAAoB;IAGlB,6BAAoB;IACpB,6BAAoB;IAkBvB,wBAsBC;IAED;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAOhB;IAED;;;OAGG;IACH,sBAKC;IAJA,cAGC;IAGF;;;OAGG;IACH,oBA+CC;IAED
|
|
1
|
+
{"version":3,"file":"imagelayer.d.ts","sourceRoot":"","sources":["../../src/renderable/imagelayer.js"],"names":[],"mappings":"AAYA;;;GAGG;AAEH;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;OAgBG;IACH,eAhBW,MAAM,KACN,MAAM,YAEd;QAA4E,KAAK,EAAzE,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,MAAM;QACvC,IAAI;QACJ,CAAC;QACQ,KAAK;QACsB,MAAM;QACjC,WAAW;KAC9C,EAoDF;IAhCA;;;;;;;;;OASG;IACH,OAHU,QAAQ,CAGqB;IAuCxC,kBAPU,MAAM,EA2Bf;IAnCD;;;;;;;;;;OAUG;IACH,cAHU,MAAM,CAKf;IAGA,4BAAoB;IAGlB,6BAAoB;IACpB,6BAAoB;IAkBvB,wBAsBC;IAED;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAOhB;IAED;;;OAGG;IACH,sBAKC;IAJA,cAGC;IAGF;;;OAGG;IACH,oBA+CC;IAED;;;;;;;;;;;;;;;OAeG;IACH,6BAmBC;IAED;;;;;OAKG;IACH,yBAHW,cAAc,GAAC,aAAa,aAC5B,QAAQ,QAoElB;IAGD,0BAMC;CAWD;mBAvVkB,aAAa;8BAIL,qBAAqB"}
|
|
@@ -185,45 +185,26 @@ export default class Renderable extends Rect {
|
|
|
185
185
|
*/
|
|
186
186
|
mask: Rect | RoundRect | Polygon | Line | Ellipse;
|
|
187
187
|
/**
|
|
188
|
-
*
|
|
189
|
-
* Use {@link
|
|
190
|
-
*
|
|
191
|
-
* - {@link FlashEffect} — flash the sprite with a solid color (hit feedback)
|
|
192
|
-
* - {@link OutlineEffect} — colored outline around the sprite (selection, hover)
|
|
193
|
-
* - {@link GlowEffect} — soft colored glow around the sprite (power-ups, magic)
|
|
194
|
-
* - {@link DesaturateEffect} — partial or full grayscale (disabled, death)
|
|
195
|
-
* - {@link PixelateEffect} — progressive pixelation (teleport, retro)
|
|
196
|
-
* - {@link BlurEffect} — box blur (defocus, backdrop)
|
|
197
|
-
* - {@link ChromaticAberrationEffect} — RGB channel offset (impact, glitch)
|
|
198
|
-
* - {@link DissolveEffect} — noise-based dissolve (death, spawn)
|
|
199
|
-
* - {@link DropShadowEffect} — offset shadow beneath the sprite
|
|
200
|
-
* - {@link ScanlineEffect} — horizontal scanlines with optional CRT curvature and vignette
|
|
201
|
-
* - {@link TintPulseEffect} — pulsing color overlay (poison, freeze, fire)
|
|
202
|
-
* - {@link WaveEffect} — sine wave distortion (underwater, heat haze)
|
|
203
|
-
* - {@link InvertEffect} — color inversion (negative image, X-ray)
|
|
204
|
-
* - {@link SepiaEffect} — warm vintage photo tone
|
|
205
|
-
* - {@link HologramEffect} — flickering holographic projection (sci-fi)
|
|
206
|
-
*
|
|
207
|
-
* Use {@link GLShader} for full control over vertex and fragment shaders.
|
|
188
|
+
* the list of post-processing shader effects applied to this renderable (WebGL only).
|
|
189
|
+
* Effects are applied in order. Use {@link addPostEffect}, {@link getPostEffect},
|
|
190
|
+
* and {@link removePostEffect} to manage effects, or assign directly.
|
|
208
191
|
* In Canvas mode, this property is ignored.
|
|
209
|
-
* @type {GLShader|ShaderEffect}
|
|
210
|
-
* @default
|
|
211
|
-
* @example
|
|
212
|
-
* // apply a built-in effect
|
|
213
|
-
* mySprite.shader = new FlashEffect(renderer, { intensity: 1.0 });
|
|
192
|
+
* @type {Array<GLShader|ShaderEffect>}
|
|
193
|
+
* @default []
|
|
214
194
|
* @example
|
|
215
|
-
* //
|
|
216
|
-
* mySprite.
|
|
217
|
-
*
|
|
218
|
-
* float gray = dot(color.rgb, vec3(0.299, 0.587, 0.114));
|
|
219
|
-
* return vec4(vec3(gray), color.a);
|
|
220
|
-
* }
|
|
221
|
-
* `);
|
|
195
|
+
* // add effects via helper methods
|
|
196
|
+
* mySprite.addPostEffect(new DesaturateEffect(renderer));
|
|
197
|
+
* mySprite.addPostEffect(new VignetteEffect(renderer));
|
|
222
198
|
* @example
|
|
223
|
-
* //
|
|
224
|
-
* mySprite.
|
|
199
|
+
* // assign directly
|
|
200
|
+
* mySprite.postEffects = [new SepiaEffect(renderer), new VignetteEffect(renderer)];
|
|
225
201
|
*/
|
|
226
|
-
|
|
202
|
+
postEffects: Array<GLShader | ShaderEffect>;
|
|
203
|
+
/**
|
|
204
|
+
* whether this renderable manages its own FBO lifecycle (e.g. Camera2d)
|
|
205
|
+
* @ignore
|
|
206
|
+
*/
|
|
207
|
+
_postEffectManaged: boolean;
|
|
227
208
|
/**
|
|
228
209
|
* the blend mode to be applied to this renderable (see renderer setBlendMode for available blend mode)
|
|
229
210
|
* @type {string}
|
|
@@ -313,6 +294,44 @@ export default class Renderable extends Rect {
|
|
|
313
294
|
* @default false
|
|
314
295
|
*/
|
|
315
296
|
get inViewport(): boolean;
|
|
297
|
+
set shader(value: GLShader | ShaderEffect | undefined);
|
|
298
|
+
/**
|
|
299
|
+
* @deprecated since 19.2.0 — use {@link addPostEffect} / {@link getPostEffect} / {@link removePostEffect} instead
|
|
300
|
+
* @type {GLShader|ShaderEffect|undefined}
|
|
301
|
+
*/
|
|
302
|
+
get shader(): GLShader | ShaderEffect | undefined;
|
|
303
|
+
/**
|
|
304
|
+
* Add a post-processing shader effect to this renderable.
|
|
305
|
+
* @param {GLShader|ShaderEffect} effect - the effect to add
|
|
306
|
+
* @returns {GLShader|ShaderEffect} the added effect
|
|
307
|
+
* @example
|
|
308
|
+
* mySprite.addPostEffect(new DesaturateEffect(renderer));
|
|
309
|
+
*/
|
|
310
|
+
addPostEffect(effect: GLShader | ShaderEffect): GLShader | ShaderEffect;
|
|
311
|
+
/**
|
|
312
|
+
* Get post-processing shader effects.
|
|
313
|
+
* When called with a class, returns the first effect matching the given class.
|
|
314
|
+
* When called without arguments, returns the full effects array.
|
|
315
|
+
* @param {Function} [effectClass] - the effect class to search for
|
|
316
|
+
* @returns {GLShader|ShaderEffect|Array|undefined} the matching effect, the effects array, or undefined
|
|
317
|
+
* @example
|
|
318
|
+
* const desat = sprite.getPostEffect(DesaturateEffect);
|
|
319
|
+
* const allEffects = sprite.getPostEffect();
|
|
320
|
+
*/
|
|
321
|
+
getPostEffect(effectClass?: Function): GLShader | ShaderEffect | any[] | undefined;
|
|
322
|
+
/**
|
|
323
|
+
* Remove all post-processing shader effects.
|
|
324
|
+
* @example
|
|
325
|
+
* sprite.clearPostEffects();
|
|
326
|
+
*/
|
|
327
|
+
clearPostEffects(): void;
|
|
328
|
+
/**
|
|
329
|
+
* Remove a specific post-processing shader effect.
|
|
330
|
+
* @param {GLShader|ShaderEffect} effect - the effect to remove
|
|
331
|
+
* @example
|
|
332
|
+
* sprite.removePostEffect(effect);
|
|
333
|
+
*/
|
|
334
|
+
removePostEffect(effect: GLShader | ShaderEffect): void;
|
|
316
335
|
/**
|
|
317
336
|
* returns true if this renderable is flipped on the horizontal axis
|
|
318
337
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderable.d.ts","sourceRoot":"","sources":["../../src/renderable/renderable.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;IAaI;AAEJ;;;GAGG;AACH;IAkBG,iBAAmB;IAGpB;;;;;;;;;;OAUG;IACH,aAHU,eAAe,CAMvB;IAGD;;;;;;;OAOG;IACH,kBAFU,QAAQ,CAEoB;IAIvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,MAlCU,IAAI,CAkCO;IAErB;;;;;OAKG;IACH,MAFU,MAAM,CAEK;IAErB;;;;;;;;;;OAUG;IACH,6BAAmC;IAEnC;;;;OAIG;IACH,cAHU,OAAO,CAGQ;IAEzB;;;;OAIG;IACH,kBAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,cAHU,OAAO,CAGQ;IAEzB;;;;;OAKG;IACH,UAHU,OAAO,CAGI;IAErB;;;;;;;OAOG;IACH,qBAHU,OAAO,CAGe;IAEhC;;;;;;;;;;;;;;;;OAgBG;IACH,eAdU,OAAO,CAcQ;IAEzB;;;;;;;OAOG;IACH,OAHU,MAAM,CAGA;IAEhB;;;;OAIG;IACH,UAHU,SAAS,GAAC,MAAM,CAGD;IAEzB;;;;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