melonjs 19.4.0 → 19.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +18 -2
  2. package/build/application/application.d.ts.map +1 -1
  3. package/build/application/settings.d.ts +25 -2
  4. package/build/application/settings.d.ts.map +1 -1
  5. package/build/audio/audio.d.ts +77 -253
  6. package/build/audio/audio.d.ts.map +1 -1
  7. package/build/audio/backend.d.ts +121 -0
  8. package/build/audio/backend.d.ts.map +1 -0
  9. package/build/audio/playback.d.ts +157 -0
  10. package/build/audio/playback.d.ts.map +1 -0
  11. package/build/audio/procedural.d.ts +105 -0
  12. package/build/audio/procedural.d.ts.map +1 -0
  13. package/build/audio/types.d.ts +205 -0
  14. package/build/audio/types.d.ts.map +1 -0
  15. package/build/index.d.ts +6 -3
  16. package/build/index.d.ts.map +1 -1
  17. package/build/index.js +2447 -396
  18. package/build/index.js.map +4 -4
  19. package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
  20. package/build/level/tiled/TMXTileset.d.ts +12 -0
  21. package/build/level/tiled/TMXTileset.d.ts.map +1 -1
  22. package/build/level/tiled/factories/shape.d.ts +1 -1
  23. package/build/level/tiled/factories/shape.d.ts.map +1 -1
  24. package/build/level/tiled/factories/tile.d.ts.map +1 -1
  25. package/build/loader/loader.d.ts +2 -2
  26. package/build/loader/loader.d.ts.map +1 -1
  27. package/build/loader/parsers/aseprite.d.ts +37 -0
  28. package/build/loader/parsers/aseprite.d.ts.map +1 -0
  29. package/build/physics/adapter.d.ts +560 -0
  30. package/build/physics/adapter.d.ts.map +1 -0
  31. package/build/physics/bounds.d.ts +18 -5
  32. package/build/physics/bounds.d.ts.map +1 -1
  33. package/build/physics/builtin/body.d.ts +605 -0
  34. package/build/physics/builtin/body.d.ts.map +1 -0
  35. package/build/physics/builtin/builtin-adapter.d.ts +91 -0
  36. package/build/physics/builtin/builtin-adapter.d.ts.map +1 -0
  37. package/build/physics/builtin/detector.d.ts +167 -0
  38. package/build/physics/builtin/detector.d.ts.map +1 -0
  39. package/build/physics/builtin/quadtree.d.ts +112 -0
  40. package/build/physics/builtin/quadtree.d.ts.map +1 -0
  41. package/build/physics/builtin/raycast.d.ts +4 -0
  42. package/build/physics/builtin/raycast.d.ts.map +1 -0
  43. package/build/physics/{sat.d.ts → builtin/sat.d.ts} +7 -7
  44. package/build/physics/builtin/sat.d.ts.map +1 -0
  45. package/build/physics/world.d.ts +61 -26
  46. package/build/physics/world.d.ts.map +1 -1
  47. package/build/renderable/collectable.d.ts +7 -1
  48. package/build/renderable/collectable.d.ts.map +1 -1
  49. package/build/renderable/container.d.ts +0 -13
  50. package/build/renderable/container.d.ts.map +1 -1
  51. package/build/renderable/renderable.d.ts +78 -17
  52. package/build/renderable/renderable.d.ts.map +1 -1
  53. package/build/renderable/trigger.d.ts +14 -1
  54. package/build/renderable/trigger.d.ts.map +1 -1
  55. package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
  56. package/build/system/timer.d.ts +0 -5
  57. package/build/system/timer.d.ts.map +1 -1
  58. package/build/video/canvas/canvas_renderer.d.ts +0 -130
  59. package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
  60. package/build/video/renderer.d.ts +111 -0
  61. package/build/video/renderer.d.ts.map +1 -1
  62. package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
  63. package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
  64. package/build/video/webgl/effects/shine.d.ts +87 -0
  65. package/build/video/webgl/effects/shine.d.ts.map +1 -0
  66. package/build/video/webgl/glshader.d.ts +46 -16
  67. package/build/video/webgl/glshader.d.ts.map +1 -1
  68. package/build/video/webgl/shadereffect.d.ts +23 -4
  69. package/build/video/webgl/shadereffect.d.ts.map +1 -1
  70. package/build/video/webgl/utils/uniforms.d.ts +8 -0
  71. package/build/video/webgl/utils/uniforms.d.ts.map +1 -1
  72. package/build/video/webgl/webgl_renderer.d.ts +0 -106
  73. package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
  74. package/package.json +1 -1
  75. package/build/physics/body.d.ts +0 -351
  76. package/build/physics/body.d.ts.map +0 -1
  77. package/build/physics/detector.d.ts +0 -72
  78. package/build/physics/detector.d.ts.map +0 -1
  79. package/build/physics/quadtree.d.ts +0 -69
  80. package/build/physics/quadtree.d.ts.map +0 -1
  81. package/build/physics/sat.d.ts.map +0 -1
@@ -0,0 +1,87 @@
1
+ /**
2
+ * A shader effect that sweeps a bright highlight band across the sprite —
3
+ * the classic "shine" pass commonly used for coins, gems, polished metal,
4
+ * and hover-highlighted UI elements. Similar to pixi-filters' ShineFilter.
5
+ *
6
+ * Set `bands` > 1 to tile the sweep into N parallel glints (useful for the
7
+ * "etched grooves" look of a coin's rim). An optional subtle brightness
8
+ * pulse can be layered on top via `pulseDepth` — set to 0 to disable.
9
+ *
10
+ * The `time` uniform must be updated each frame for the animation.
11
+ * @category Effects
12
+ * @see {@link Renderable.shader} for usage
13
+ * @example
14
+ * // single diagonal sweep — classic "button shine"
15
+ * const shine = new ShineEffect(renderer, {
16
+ * color: [1.0, 0.95, 0.7],
17
+ * speed: 0.5,
18
+ * width: 0.18,
19
+ * angle: 0.5,
20
+ * });
21
+ *
22
+ * // gold coin with ~14 parallel glints and a subtle brightness pulse
23
+ * const coinShine = new ShineEffect(renderer, {
24
+ * color: [1.0, 0.95, 0.7],
25
+ * bands: 14.5,
26
+ * width: 0.15,
27
+ * intensity: 0.4,
28
+ * speed: 0.8,
29
+ * pulseDepth: 0.08,
30
+ * });
31
+ *
32
+ * mySprite.addPostEffect(coinShine);
33
+ *
34
+ * // update each frame
35
+ * coinShine.setTime(timer.getTime() / 1000);
36
+ */
37
+ export default class ShineEffect extends ShaderEffect {
38
+ /**
39
+ * @param {import("../webgl_renderer.js").default} renderer - the current renderer instance
40
+ * @param {object} [options] - effect options
41
+ * @param {number[]} [options.color=[1.0, 1.0, 1.0]] - shine color as [r, g, b] (0.0–1.0)
42
+ * @param {number} [options.speed=0.5] - sweeps per second
43
+ * @param {number} [options.width=0.15] - glint half-width as a fraction of one tile (0.0–1.0)
44
+ * @param {number} [options.intensity=0.5] - maximum highlight strength
45
+ * @param {number} [options.angle=0.5] - sweep direction in radians (0 = horizontal L→R, π/2 = vertical T→B)
46
+ * @param {number} [options.bands=1.0] - number of parallel glints (1 = single shine; ~14.5 mimics a coin's etched-rim look)
47
+ * @param {number} [options.pulseDepth=0.0] - subtle base-brightness pulse amplitude (0 disables the pulse)
48
+ * @param {number} [options.pulseSpeed=3.0] - pulse oscillation rate (radians/second)
49
+ */
50
+ constructor(renderer: import("../webgl_renderer.js").default, options?: {
51
+ color?: number[] | undefined;
52
+ speed?: number | undefined;
53
+ width?: number | undefined;
54
+ intensity?: number | undefined;
55
+ angle?: number | undefined;
56
+ bands?: number | undefined;
57
+ pulseDepth?: number | undefined;
58
+ pulseSpeed?: number | undefined;
59
+ });
60
+ /**
61
+ * set the current time (call each frame for animation)
62
+ * @param {number} time - time in seconds
63
+ */
64
+ setTime(time: number): void;
65
+ /**
66
+ * set the shine color
67
+ * @param {number[]} color - shine color as [r, g, b] (0.0–1.0)
68
+ */
69
+ setColor(color: number[]): void;
70
+ /**
71
+ * set the sweep speed
72
+ * @param {number} value - sweeps per second
73
+ */
74
+ setSpeed(value: number): void;
75
+ /**
76
+ * set the highlight intensity
77
+ * @param {number} value - maximum highlight strength
78
+ */
79
+ setIntensity(value: number): void;
80
+ /**
81
+ * set the number of parallel glints
82
+ * @param {number} value - 1 for a single shine, >1 for tiled stripes
83
+ */
84
+ setBands(value: number): void;
85
+ }
86
+ import ShaderEffect from "../shadereffect.js";
87
+ //# sourceMappingURL=shine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shine.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/effects/shine.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IACC;;;;;;;;;;;OAWG;IACH,sBAXW,OAAO,sBAAsB,EAAE,OAAO,YAE9C;QAA2B,KAAK;QACP,KAAK;QACL,KAAK;QACL,SAAS;QACT,KAAK;QACL,KAAK;QACL,UAAU;QACV,UAAU;KACrC,EAuDA;IAED;;;OAGG;IACH,cAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;IAED;;;OAGG;IACH,gBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,oBAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,gBAFW,MAAM,QAIhB;CACD;yBAlJwB,oBAAoB"}
@@ -37,30 +37,57 @@ export default class GLShader {
37
37
  */
38
38
  gl: WebGLRenderingContext;
39
39
  /**
40
- * the vertex shader source code
41
- * @type {string}
40
+ * `true` once {@link destroy} has been called. After this flag is
41
+ * `true`, every method on the shader is a silent no-op — callers
42
+ * holding a stale reference (e.g. a still-registered update loop)
43
+ * do not crash the frame.
44
+ * @type {boolean}
45
+ * @readonly
42
46
  */
43
- vertex: string;
47
+ readonly destroyed: boolean;
44
48
  /**
45
- * the fragment shader source code
46
- * @type {string}
49
+ * `true` while the WebGL context is lost (and until it's
50
+ * restored). The GL program/attributes/uniforms are released
51
+ * during the suspended window but the shader source code is
52
+ * preserved so {@link _onContextRestored} can rebuild the
53
+ * program against the new context. User code generally doesn't
54
+ * read this — methods short-circuit internally — but it's
55
+ * available for diagnostic / debug-plugin tooling.
56
+ * @type {boolean}
57
+ * @readonly
47
58
  */
48
- fragment: string;
59
+ readonly suspended: boolean;
60
+ _sourceVertex: string;
61
+ _sourceFragment: string;
62
+ _precision: string | undefined;
63
+ _uniformCache: any;
64
+ program: WebGLProgram;
65
+ uniforms: object;
66
+ attributes: number[];
49
67
  /**
50
- * the location attributes of the shader
51
- * @type {GLint[]}
68
+ * (Re)compile the shader program against `this.gl` from the
69
+ * preserved source. Called from the constructor and from
70
+ * {@link _onContextRestored}. Replays any cached uniform values
71
+ * against the freshly-extracted uniforms proxy.
72
+ * @private
52
73
  */
53
- attributes: GLint[];
74
+ private _compile;
75
+ vertex: any;
76
+ fragment: any;
54
77
  /**
55
- * a reference to the shader program (once compiled)
56
- * @type {WebGLProgram}
78
+ * Handler for {@link ONCONTEXT_LOST}. Tears down the GL program
79
+ * but preserves the shader source + cached uniform values so the
80
+ * shader can be transparently rebuilt on context restore.
81
+ * @private
57
82
  */
58
- program: WebGLProgram;
83
+ private _onContextLost;
59
84
  /**
60
- * the uniforms of the shader
61
- * @type {object}
85
+ * Handler for {@link ONCONTEXT_RESTORED}. Re-compiles and
86
+ * re-links the shader against the new GL context, then replays
87
+ * any cached uniform values via {@link _compile}.
88
+ * @private
62
89
  */
63
- uniforms: object;
90
+ private _onContextRestored;
64
91
  /**
65
92
  * Installs this shader program as part of current rendering state
66
93
  */
@@ -87,7 +114,10 @@ export default class GLShader {
87
114
  */
88
115
  setVertexAttributes(gl: WebGLRenderingContext, attributes: object[], stride: number): void;
89
116
  /**
90
- * destroy this shader objects resources (program, attributes, uniforms)
117
+ * destroy this shader objects resources (program, attributes, uniforms).
118
+ * Idempotent — calling destroy twice (or after a context-lost suspend)
119
+ * is safe. Unsubscribes from the renderer's context lost / restored
120
+ * events so a destroyed shader is never automatically resurrected.
91
121
  */
92
122
  destroy(): void;
93
123
  }
@@ -1 +1 @@
1
- {"version":3,"file":"glshader.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/glshader.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,gBA1BW,qBAAqB,UACrB,MAAM,YACN,MAAM,cACN,MAAM,EAyEhB;IAjDA;;;OAGG;IACH,IAFU,qBAAqB,CAEnB;IAEZ;;;OAGG;IACH,QAFU,MAAM,CAKf;IAED;;;OAGG;IACH,UAFU,MAAM,CAKf;IAED;;;OAGG;IACH,YAFU,KAAK,EAAE,CAEiC;IAElD;;;OAGG;IACH,SAFU,YAAY,CAOrB;IAED;;;OAGG;IACH,UAFU,MAAM,CAE8B;IAM/C;;OAEG;IACH,aAEC;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,KAAK,CASjB;IAED;;;;;;OAMG;IACH,iBALW,MAAM,SACN,MAAM,GAAC,YAAY,QAiB7B;IAED;;;;;OAKG;IACH,wBAJW,qBAAqB,cACrB,MAAM,EAAE,UACR,MAAM,QAmBhB;IAED;;OAEG;IACH,gBAQC;CACD"}
1
+ {"version":3,"file":"glshader.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/glshader.js"],"names":[],"mappings":"AAYA;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,gBA1BW,qBAAqB,UACrB,MAAM,YACN,MAAM,cACN,MAAM,EAyEhB;IAjDA;;;OAGG;IACH,IAFU,qBAAqB,CAEnB;IAEZ;;;;;;;OAOG;IACH,oBAHU,OAAO,CAGK;IAEtB;;;;;;;;;;OAUG;IACH,oBAHU,OAAO,CAGK;IAGtB,sBAA2B;IAC3B,wBAA+B;IAC/B,+BAA2B;IAG3B,mBAAwC;IAKvC,sBAAmB;IACnB,iBAAoB;IACpB,qBAAsB;IASxB;;;;;;OAMG;IACH,iBA0CC;IAzCA,YAGC;IACD,cAGC;IAoCF;;;;;OAKG;IACH,uBAgBC;IAED;;;;;OAKG;IACH,2BAMC;IAED;;OAEG;IACH,aAKC;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,KAAK,CAYjB;IAED;;;;;;OAMG;IACH,iBALW,MAAM,SACN,MAAM,GAAC,YAAY,QA0C7B;IAED;;;;;OAKG;IACH,wBAJW,qBAAqB,cACrB,MAAM,EAAE,UACR,MAAM,QAmBhB;IAED;;;;;OAKG;IACH,gBA2BC;CACD"}
@@ -35,12 +35,29 @@ export default class ShaderEffect {
35
35
  */
36
36
  constructor(renderer: WebGLRenderer | CanvasRenderer, fragmentBody: string, precision?: string);
37
37
  /**
38
- * whether this effect is active (false in Canvas mode)
38
+ * whether this effect is active (false in Canvas mode, false after
39
+ * {@link destroy}, and false while the WebGL context is suspended
40
+ * between an `ONCONTEXT_LOST` and the matching `ONCONTEXT_RESTORED`
41
+ * event).
39
42
  * @type {boolean}
40
43
  */
41
44
  enabled: boolean;
45
+ /**
46
+ * `true` once {@link destroy} has been called. Distinct from
47
+ * `enabled` — which also toggles transiently across a context
48
+ * lost / restored cycle — to give callers a stable signal for
49
+ * "this effect has been explicitly released."
50
+ * @type {boolean}
51
+ * @readonly
52
+ */
53
+ readonly destroyed: boolean;
42
54
  /** @ignore */
43
55
  _shader: GLShader | undefined;
56
+ /** @private */
57
+ private _onContextLost;
58
+ _enabledBeforeSuspend: boolean | undefined;
59
+ /** @private */
60
+ private _onContextRestored;
44
61
  /**
45
62
  * Set the uniform to the given value
46
63
  * @param {string} name - the uniform name
@@ -56,15 +73,17 @@ export default class ShaderEffect {
56
73
  /** @ignore */
57
74
  get program(): WebGLProgram | null;
58
75
  /** @ignore */
59
- get vertex(): string | null;
76
+ get vertex(): any;
60
77
  /** @ignore */
61
- get fragment(): string | null;
78
+ get fragment(): any;
62
79
  /** @ignore */
63
80
  get attributes(): {};
64
81
  /** @ignore */
65
82
  get uniforms(): object;
66
83
  /**
67
- * destroy this shader effect
84
+ * destroy this shader effect. Idempotent — calling destroy twice
85
+ * is safe. Unsubscribes from the renderer's context-lost / restored
86
+ * events so a destroyed effect is not auto-reactivated.
68
87
  */
69
88
  destroy(): void;
70
89
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shadereffect.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/shadereffect.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IAOC;;;;;;OAMG;IACH,sBANW,aAAa,GAAC,cAAc,gBAC5B,MAAM,cAGN,MAAM,EAsChB;IAjDD;;;OAGG;IACH,SAFU,OAAO,CAED;IAqCf,cAAc;IACd,8BAKC;IAIF;;;;OAIG;IACH,iBAHW,MAAM,SACN,MAAM,GAAC,YAAY,QAM7B;IAED,cAAc;IACd,aAIC;IAED,cAAc;IACd,qCAEC;IAED,cAAc;IACd,iEAIC;IAED,cAAc;IACd,mCAEC;IAED,cAAc;IACd,4BAEC;IAED,cAAc;IACd,8BAEC;IAED,cAAc;IACd,qBAEC;IAED,cAAc;IACd,uBAEC;IAED;;OAEG;IACH,gBAKC;CACD;qBAlJoB,eAAe"}
1
+ {"version":3,"file":"shadereffect.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/shadereffect.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IAoBC;;;;;;OAMG;IACH,sBANW,aAAa,GAAC,cAAc,gBAC5B,MAAM,cAGN,MAAM,EAkChB;IA1DD;;;;;;OAMG;IACH,SAFU,OAAO,CAED;IAEhB;;;;;;;OAOG;IACH,oBAHU,OAAO,CAGC;IA6BjB,cAAc;IACd,8BAKC;IAQF,eAAe;IACf,uBAOC;IAFA,2CAAyC;IAI1C,eAAe;IACf,2BAQC;IAED;;;;OAIG;IACH,iBAHW,MAAM,SACN,MAAM,GAAC,YAAY,QAM7B;IAED,cAAc;IACd,aAIC;IAED,cAAc;IACd,qCAEC;IAED,cAAc;IACd,iEAIC;IAED,cAAc;IACd,mCAEC;IAED,cAAc;IACd,kBAEC;IAED,cAAc;IACd,oBAEC;IAED,cAAc;IACd,qBAEC;IAED,cAAc;IACd,uBAEC;IAED;;;;OAIG;IACH,gBAiBC;CACD;qBA9LoB,eAAe"}
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Capture the current value into the cache slot so future `setUniform`
3
+ * calls can short-circuit. Reuses the existing slot (and its allocation)
4
+ * when the length matches — only a length change or a first capture
5
+ * allocates a fresh array.
6
+ * @ignore
7
+ */
8
+ export function captureValue(prev: any, val: any): any;
1
9
  /**
2
10
  * Build the `uniforms` proxy object for a compiled shader program.
3
11
  *
@@ -1 +1 @@
1
- {"version":3,"file":"uniforms.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/utils/uniforms.js"],"names":[],"mappings":"AA0FA;;;;;;;;;;;;;;;GAeG;AACH,0DAmEC"}
1
+ {"version":3,"file":"uniforms.d.ts","sourceRoot":"","sources":["../../../../src/video/webgl/utils/uniforms.js"],"names":[],"mappings":"AA6DA;;;;;;GAMG;AACH,uDAoBC;AAED;;;;;;;;;;;;;;;GAeG;AACH,0DAmEC"}
@@ -22,12 +22,6 @@ export default class WebGLRenderer extends Renderer {
22
22
  * @ignore
23
23
  */
24
24
  _savedEffectProjection: Matrix3d;
25
- /**
26
- * sets or returns the thickness of lines for shape drawing
27
- * @type {number}
28
- * @default 1
29
- */
30
- lineWidth: number;
31
25
  /**
32
26
  * sets or returns the shape used to join two line segments where they meet.
33
27
  * Out of the three possible values for this property: "round", "bevel", and "miter", only "round" is supported for now in WebGL
@@ -322,58 +316,6 @@ export default class WebGLRenderer extends Renderer {
322
316
  */
323
317
  setBlendMode(mode?: string, premultipliedAlpha?: boolean): string;
324
318
  currentPremultipliedAlpha: any;
325
- /**
326
- * restores the most recently saved renderer state by popping the top entry in the drawing state stack
327
- * @example
328
- * // Save the current state
329
- * renderer.save();
330
- *
331
- * // apply a transform and draw a rect
332
- * renderer.tranform(matrix);
333
- * renderer.fillRect(10, 10, 100, 100);
334
- *
335
- * // Restore to the state saved by the most recent call to save()
336
- * renderer.restore();
337
- */
338
- restore(): void;
339
- /**
340
- * saves the entire state of the renderer by pushing the current state onto a stack.
341
- * @example
342
- * // Save the current state
343
- * renderer.save();
344
- *
345
- * // apply a transform and draw a rect
346
- * renderer.tranform(matrix);
347
- * renderer.fillRect(10, 10, 100, 100);
348
- *
349
- * // Restore to the state saved by the most recent call to save()
350
- * renderer.restore();
351
- */
352
- save(): void;
353
- /**
354
- * adds a rotation to the transformation matrix.
355
- * @param {number} angle - the rotation angle, clockwise in radians
356
- * @example
357
- * // Rotated rectangle
358
- * renderer.rotate((45 * Math.PI) / 180);
359
- * renderer.setColor("red");
360
- * renderer.fillRect(10, 10, 100, 100);
361
- *
362
- * // Reset transformation matrix to the identity matrix
363
- * renderer.setTransform(1, 0, 0, 1, 0, 0);
364
- */
365
- rotate(angle: number): void;
366
- /**
367
- * adds a scaling transformation to the renderer units horizontally and/or vertically
368
- * @param {number} x - Scaling factor in the horizontal direction. A negative value flips pixels across the vertical axis. A value of 1 results in no horizontal scaling.
369
- * @param {number} y - Scaling factor in the vertical direction. A negative value flips pixels across the horizontal axis. A value of 1 results in no vertical scaling
370
- */
371
- scale(x: number, y: number): void;
372
- /**
373
- * Set the global alpha
374
- * @param {number} alpha - 0.0 to 1.0 values accepted.
375
- */
376
- setGlobalAlpha(alpha: number): void;
377
319
  /**
378
320
  * Return the global alpha
379
321
  * @returns {number} global alpha value
@@ -400,31 +342,6 @@ export default class WebGLRenderer extends Renderer {
400
342
  * @param {boolean} [antiClockwise=false] - draw arc anti-clockwise
401
343
  */
402
344
  fillArc(x: number, y: number, radius: number, start: number, end: number, antiClockwise?: boolean): void;
403
- /**
404
- * Stroke an ellipse at the specified coordinates with given radius
405
- * @param {number} x - ellipse center point x-axis
406
- * @param {number} y - ellipse center point y-axis
407
- * @param {number} w - horizontal radius of the ellipse
408
- * @param {number} h - vertical radius of the ellipse
409
- * @param {boolean} [fill=false] - also fill the shape with the current color if true
410
- */
411
- strokeEllipse(x: number, y: number, w: number, h: number, fill?: boolean): void;
412
- /**
413
- * Fill an ellipse at the specified coordinates with given radius
414
- * @param {number} x - ellipse center point x-axis
415
- * @param {number} y - ellipse center point y-axis
416
- * @param {number} w - horizontal radius of the ellipse
417
- * @param {number} h - vertical radius of the ellipse
418
- */
419
- fillEllipse(x: number, y: number, w: number, h: number): void;
420
- /**
421
- * Stroke a line of the given two points
422
- * @param {number} startX - the start x coordinate
423
- * @param {number} startY - the start y coordinate
424
- * @param {number} endX - the end x coordinate
425
- * @param {number} endY - the end y coordinate
426
- */
427
- strokeLine(startX: number, startY: number, endX: number, endY: number): void;
428
345
  /**
429
346
  * Fill a line of the given two points
430
347
  * @param {number} startX - the start x coordinate
@@ -444,23 +361,6 @@ export default class WebGLRenderer extends Renderer {
444
361
  * @param {Polygon} poly - the shape to draw
445
362
  */
446
363
  fillPolygon(poly: Polygon): void;
447
- /**
448
- * Draw a stroke rectangle at the specified coordinates
449
- * @param {number} x - x axis of the coordinate for the rectangle starting point.
450
- * @param {number} y - y axis of the coordinate for the rectangle starting point.
451
- * @param {number} width - The rectangle's width.
452
- * @param {number} height - The rectangle's height.
453
- * @param {boolean} [fill=false] - also fill the shape with the current color if true
454
- */
455
- strokeRect(x: number, y: number, width: number, height: number, fill?: boolean): void;
456
- /**
457
- * Draw a filled rectangle at the specified coordinates
458
- * @param {number} x - x axis of the coordinate for the rectangle starting point.
459
- * @param {number} y - y axis of the coordinate for the rectangle starting point.
460
- * @param {number} width - The rectangle's width.
461
- * @param {number} height - The rectangle's height.
462
- */
463
- fillRect(x: number, y: number, width: number, height: number): void;
464
364
  /**
465
365
  * Stroke a rounded rectangle at the specified coordinates
466
366
  * @param {number} x - x axis of the coordinate for the rounded rectangle starting point.
@@ -514,12 +414,6 @@ export default class WebGLRenderer extends Renderer {
514
414
  * @param {number} f - the f component to multiply the current matrix by
515
415
  */
516
416
  transform(a: Matrix2d | Matrix3d | number, b: number, c: number, d: number, e: number, f: number): void;
517
- /**
518
- * adds a translation transformation to the current matrix.
519
- * @param {number} x - Distance to move in the horizontal direction. Positive values are to the right, and negative to the left.
520
- * @param {number} y - Distance to move in the vertical direction. Positive values are down, and negative are up.
521
- */
522
- translate(x: number, y: number): void;
523
417
  /**
524
418
  * clip the given region from the original canvas. Once a region is clipped,
525
419
  * all future drawing will be limited to the clipped region.
@@ -1 +1 @@
1
- {"version":3,"file":"webgl_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/webgl_renderer.js"],"names":[],"mappings":"AAsDA;;;GAGG;AACH;IAQE;;;;;OAKG;IACH,oBAJU,MAAM,CAIU;IAU1B;;;;OAIG;IACH,IAFU,qBAAqB,CAEI;IAYnC;;;;OAIG;IACH,wBAHU,QAAQ,CAG0B;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;OAIG;IACH,aAHW,MAAM,KACN,MAAM,QAIhB;IAgED;;;;;;;;;OASG;IACH,gBAPW,QAAQ,GAAC,QAAQ,GAAC,MAAM,KACxB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QAKhB;IAED;;;;;;;;;OASG;IACH,aAPW,QAAQ,GAAC,QAAQ,GAAC,MAAM,KACxB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QAmChB;IAED;;;;OAIG;IACH,aAHW,MAAM,KACN,MAAM,QAUhB;IAED;;;;;;;;;;OAUG;IACH,YALW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QA+EhB;IAED;;;;;;;OAOG;IACH,eAHW,IAAI,GAAC,SAAS,GAAC,OAAO,GAAC,IAAI,GAAC,OAAO,WACnC,OAAO,QA6CjB;;CAcD;qBAn3EoB,kBAAkB;yBAXd,wBAAwB;uBAC1B,yBAAyB;6BAsCtB,uBAAuB;yBAxBxB,uBAAuB;iCAUf,6BAA6B;6BAXpB,uBAAuB;0CAavB,oCAAoC;sBA7B7C,uBAAuB;0BAkCjC,iCAAiC;+BAC5B,iCAAiC;6BACnC,6BAA6B;0BAChC,4BAA4B;6BACzB,+BAA+B;8BAC9B,wBAAwB"}
1
+ {"version":3,"file":"webgl_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/webgl/webgl_renderer.js"],"names":[],"mappings":"AAsDA;;;GAGG;AACH;IAQE;;;;;OAKG;IACH,oBAJU,MAAM,CAIU;IAU1B;;;;OAIG;IACH,IAFU,qBAAqB,CAEI;IAYnC;;;;OAIG;IACH,wBAHU,QAAQ,CAG0B;IAS5C;;;;;OAKG;IACH,UAHU,MAAM,CAGO;IAEvB;;;OAGG;IACH,cAFU,WAAW,CAEqB;IAE1C;;;;OAIG;IACH,sBAHU,MAAM,CAGwD;IAExE;;;;OAIG;IACH,iBAHU,MAAM,CAMf;IAED;;;OAGG;IACH;;;QAEE;IAIF,kBAA6B;IAG7B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iBALW,MAAM,UACN,MAAM,QACN,MAAM,QACN,MAAM,QAIhB;IAED;;;;OAIG;IACH,oBAHW,OAAO,SACP,OAAO,QAkDjB;IAED;;;OAGG;IACH,kBAFW,OAAO,QAuDjB;IAuED;;;;;;;;OAQG;IACH,mBAPW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,UACN,MAAM,SACN,OAAO,QAWjB;IAED;;;;;;;OAOG;IACH,iBANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,UACN,MAAM,QA4FhB;IAED;;;;OAIG;IACH,eAHW,MAAM,KACN,MAAM,QAIhB;IAED;;;;OAIG;IACH,aAHW,MAAM,KACN,MAAM,QAIhB;IAgED;;;;;;;;;OASG;IACH,gBAPW,QAAQ,GAAC,QAAQ,GAAC,MAAM,KACxB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QAKhB;IAED;;;;;;;;;OASG;IACH,aAPW,QAAQ,GAAC,QAAQ,GAAC,MAAM,KACxB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QAmChB;IAiBD;;;;;;;;;;OAUG;IACH,YALW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QA+EhB;IAED;;;;;;;OAOG;IACH,eAHW,IAAI,GAAC,SAAS,GAAC,OAAO,GAAC,IAAI,GAAC,OAAO,WACnC,OAAO,QA6CjB;;CAcD;qBAt4EoB,kBAAkB;yBAXd,wBAAwB;uBAC1B,yBAAyB;6BAsCtB,uBAAuB;yBAxBxB,uBAAuB;iCAUf,6BAA6B;6BAXpB,uBAAuB;0CAavB,oCAAoC;sBA7B7C,uBAAuB;0BAkCjC,iCAAiC;+BAC5B,iCAAiC;6BACnC,6BAA6B;0BAChC,4BAA4B;6BACzB,+BAA+B;8BAC9B,wBAAwB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "melonjs",
3
- "version": "19.4.0",
3
+ "version": "19.6.0",
4
4
  "description": "melonJS Game Engine",
5
5
  "homepage": "http://www.melonjs.org/",
6
6
  "type": "module",