melonjs 10.2.3 → 10.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/dist/melonjs.js +1741 -1558
- package/dist/melonjs.min.js +4 -4
- package/dist/melonjs.module.d.ts +1256 -1758
- package/dist/melonjs.module.js +1734 -1582
- package/package.json +12 -12
- package/src/audio/audio.js +3 -3
- package/src/camera/camera2d.js +26 -27
- package/src/entity/draggable.js +10 -19
- package/src/entity/droptarget.js +12 -20
- package/src/entity/entity.js +13 -13
- package/src/game.js +6 -6
- package/src/{shapes → geometries}/ellipse.js +19 -20
- package/src/{shapes → geometries}/line.js +6 -7
- package/src/{shapes → geometries}/poly.js +70 -23
- package/src/{shapes → geometries}/rectangle.js +23 -24
- package/src/index.js +8 -9
- package/src/input/gamepad.js +7 -7
- package/src/input/input.js +2 -2
- package/src/input/keyboard.js +108 -108
- package/src/input/pointer.js +61 -28
- package/src/input/pointerevent.js +79 -16
- package/src/lang/deprecated.js +26 -15
- package/src/level/level.js +10 -10
- package/src/level/tiled/TMXGroup.js +6 -7
- package/src/level/tiled/TMXLayer.js +10 -11
- package/src/level/tiled/TMXObject.js +57 -51
- package/src/level/tiled/TMXTile.js +2 -3
- package/src/level/tiled/TMXTileMap.js +3 -4
- package/src/level/tiled/TMXTileset.js +1 -2
- package/src/level/tiled/TMXTilesetGroup.js +1 -2
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +2 -3
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +2 -3
- package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +2 -3
- package/src/level/tiled/renderer/TMXRenderer.js +1 -2
- package/src/level/tiled/renderer/TMXStaggeredRenderer.js +2 -3
- package/src/loader/loader.js +17 -15
- package/src/loader/loadingscreen.js +1 -2
- package/src/math/color.js +23 -24
- package/src/math/math.js +16 -16
- package/src/math/matrix2.js +24 -25
- package/src/math/matrix3.js +26 -27
- package/src/math/observable_vector2.js +46 -35
- package/src/math/observable_vector3.js +54 -36
- package/src/math/vector2.js +58 -47
- package/src/math/vector3.js +66 -48
- package/src/particles/emitter.js +64 -72
- package/src/particles/particle.js +3 -4
- package/src/particles/particlecontainer.js +2 -3
- package/src/physics/body.js +38 -39
- package/src/physics/bounds.js +30 -32
- package/src/physics/collision.js +6 -6
- package/src/physics/detector.js +3 -3
- package/src/physics/quadtree.js +8 -9
- package/src/physics/sat.js +4 -4
- package/src/physics/world.js +11 -12
- package/src/plugin/plugin.js +6 -7
- package/src/renderable/GUI.js +7 -8
- package/src/renderable/collectable.js +3 -4
- package/src/renderable/colorlayer.js +7 -8
- package/src/renderable/container.js +36 -37
- package/src/renderable/imagelayer.js +4 -5
- package/src/renderable/nineslicesprite.js +2 -3
- package/src/renderable/renderable.js +45 -46
- package/src/renderable/sprite.js +16 -17
- package/src/renderable/trigger.js +4 -5
- package/src/state/stage.js +8 -9
- package/src/state/state.js +24 -24
- package/src/system/device.js +41 -97
- package/src/system/event.js +45 -33
- package/src/system/pooling.js +1 -1
- package/src/system/save.js +3 -3
- package/src/system/timer.js +13 -13
- package/src/text/bitmaptext.js +12 -13
- package/src/text/bitmaptextdata.js +5 -6
- package/src/text/text.js +16 -17
- package/src/tweens/easing.js +1 -1
- package/src/tweens/interpolation.js +1 -1
- package/src/tweens/tween.js +14 -15
- package/src/utils/agent.js +3 -3
- package/src/utils/array.js +4 -4
- package/src/utils/file.js +3 -3
- package/src/utils/function.js +3 -3
- package/src/utils/string.js +7 -7
- package/src/utils/utils.js +4 -4
- package/src/video/canvas/canvas_renderer.js +39 -40
- package/src/video/renderer.js +29 -30
- package/src/video/texture.js +8 -9
- package/src/video/texture_cache.js +2 -4
- package/src/video/video.js +7 -7
- package/src/video/webgl/buffer/vertex.js +2 -2
- package/src/video/webgl/glshader.js +11 -12
- package/src/video/webgl/webgl_compositor.js +118 -90
- package/src/video/webgl/webgl_renderer.js +95 -74
|
@@ -15,9 +15,8 @@ import { isPowerOfTwo, nextPowerOfTwo, TAU } from "./../../math/math.js";
|
|
|
15
15
|
* @classdesc
|
|
16
16
|
* a WebGL renderer object
|
|
17
17
|
* @class WebGLRenderer
|
|
18
|
-
* @
|
|
19
|
-
* @
|
|
20
|
-
* @constructor
|
|
18
|
+
* @augments me.Renderer
|
|
19
|
+
* @memberof me
|
|
21
20
|
* @param {object} options The renderer parameters
|
|
22
21
|
* @param {number} options.width The width of the canvas without scaling
|
|
23
22
|
* @param {number} options.height The height of the canvas without scaling
|
|
@@ -43,7 +42,7 @@ class WebGLRenderer extends Renderer {
|
|
|
43
42
|
/**
|
|
44
43
|
* The WebGL version used by this renderer (1 or 2)
|
|
45
44
|
* @name WebGLVersion
|
|
46
|
-
* @
|
|
45
|
+
* @memberof me.WebGLRenderer
|
|
47
46
|
* @type {number}
|
|
48
47
|
* @default 1
|
|
49
48
|
* @readonly
|
|
@@ -53,7 +52,7 @@ class WebGLRenderer extends Renderer {
|
|
|
53
52
|
/**
|
|
54
53
|
* The vendor string of the underlying graphics driver.
|
|
55
54
|
* @name GPUVendor
|
|
56
|
-
* @
|
|
55
|
+
* @memberof me.WebGLRenderer
|
|
57
56
|
* @type {string}
|
|
58
57
|
* @default null
|
|
59
58
|
* @readonly
|
|
@@ -63,7 +62,7 @@ class WebGLRenderer extends Renderer {
|
|
|
63
62
|
/**
|
|
64
63
|
* The renderer string of the underlying graphics driver.
|
|
65
64
|
* @name GPURenderer
|
|
66
|
-
* @
|
|
65
|
+
* @memberof me.WebGLRenderer
|
|
67
66
|
* @type {string}
|
|
68
67
|
* @default null
|
|
69
68
|
* @readonly
|
|
@@ -73,7 +72,7 @@ class WebGLRenderer extends Renderer {
|
|
|
73
72
|
/**
|
|
74
73
|
* The WebGL context
|
|
75
74
|
* @name gl
|
|
76
|
-
* @
|
|
75
|
+
* @memberof me.WebGLRenderer
|
|
77
76
|
* type {WebGLRenderingContext}
|
|
78
77
|
*/
|
|
79
78
|
this.context = this.gl = this.getContextGL(this.getScreenCanvas(), options.transparent);
|
|
@@ -81,7 +80,7 @@ class WebGLRenderer extends Renderer {
|
|
|
81
80
|
/**
|
|
82
81
|
* Maximum number of texture unit supported under the current context
|
|
83
82
|
* @name maxTextures
|
|
84
|
-
* @
|
|
83
|
+
* @memberof me.WebGLRenderer
|
|
85
84
|
* @type {number}
|
|
86
85
|
* @readonly
|
|
87
86
|
*/
|
|
@@ -116,7 +115,7 @@ class WebGLRenderer extends Renderer {
|
|
|
116
115
|
* The current transformation matrix used for transformations on the overall scene
|
|
117
116
|
* @name currentTransform
|
|
118
117
|
* @type {me.Matrix2d}
|
|
119
|
-
* @
|
|
118
|
+
* @memberof me.WebGLRenderer#
|
|
120
119
|
*/
|
|
121
120
|
this.currentTransform = new Matrix2d();
|
|
122
121
|
|
|
@@ -124,13 +123,22 @@ class WebGLRenderer extends Renderer {
|
|
|
124
123
|
* The current compositor used by the renderer
|
|
125
124
|
* @name currentCompositor
|
|
126
125
|
* @type {me.WebGLCompositor}
|
|
127
|
-
* @
|
|
126
|
+
* @memberof me.WebGLRenderer#
|
|
128
127
|
*/
|
|
129
128
|
this.currentCompositor = null;
|
|
130
129
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
/**
|
|
131
|
+
* The list of active compositors
|
|
132
|
+
* @name compositors
|
|
133
|
+
* @type {Map}
|
|
134
|
+
* @memberof me.WebGLRenderer#
|
|
135
|
+
*/
|
|
136
|
+
this.compositors = new Map();
|
|
137
|
+
|
|
138
|
+
// Create a default compositor
|
|
139
|
+
var compositor = new (this.settings.compositor || WebGLCompositor)(this);
|
|
140
|
+
this.compositors.set("default", compositor);
|
|
141
|
+
this.setCompositor(compositor);
|
|
134
142
|
|
|
135
143
|
|
|
136
144
|
// default WebGL state(s)
|
|
@@ -172,17 +180,21 @@ class WebGLRenderer extends Renderer {
|
|
|
172
180
|
/**
|
|
173
181
|
* Reset context state
|
|
174
182
|
* @name reset
|
|
175
|
-
* @
|
|
183
|
+
* @memberof me.WebGLRenderer.prototype
|
|
176
184
|
* @function
|
|
177
185
|
*/
|
|
178
186
|
reset() {
|
|
179
187
|
super.reset();
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
this.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
188
|
+
|
|
189
|
+
this.compositors.forEach((compositor) => {
|
|
190
|
+
if (this.isContextValid === false) {
|
|
191
|
+
// on context lost/restore
|
|
192
|
+
compositor.init(this);
|
|
193
|
+
} else {
|
|
194
|
+
compositor.reset();
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
|
|
186
198
|
this.gl.disable(this.gl.SCISSOR_TEST);
|
|
187
199
|
if (typeof this.fontContext2D !== "undefined" ) {
|
|
188
200
|
this.createFontTexture(this.cache);
|
|
@@ -191,25 +203,37 @@ class WebGLRenderer extends Renderer {
|
|
|
191
203
|
}
|
|
192
204
|
|
|
193
205
|
/**
|
|
194
|
-
*
|
|
206
|
+
* set the active compositor for this renderer
|
|
195
207
|
* @name setCompositor
|
|
196
208
|
* @function
|
|
197
|
-
* @param {WebGLCompositor} compositor a compositor instance
|
|
198
|
-
* @
|
|
209
|
+
* @param {me.WebGLCompositor|string} compositor a compositor name or instance
|
|
210
|
+
* @memberof me.WebGLRenderer.prototype
|
|
199
211
|
* @function
|
|
200
212
|
*/
|
|
201
|
-
setCompositor(compositor) {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
this.
|
|
213
|
+
setCompositor(compositor = "default") {
|
|
214
|
+
|
|
215
|
+
if (typeof compositor === "string") {
|
|
216
|
+
compositor = this.compositors.get(compositor);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (typeof compositor === "undefined") {
|
|
220
|
+
throw new Error("Invalid WebGL Compositor");
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (this.currentCompositor !== compositor) {
|
|
224
|
+
if (this.currentCompositor !== null) {
|
|
225
|
+
// flush the current compositor
|
|
226
|
+
this.currentCompositor.flush();
|
|
227
|
+
}
|
|
228
|
+
// set given one as current
|
|
229
|
+
this.currentCompositor = compositor;
|
|
205
230
|
}
|
|
206
|
-
this.currentCompositor = compositor;
|
|
207
231
|
}
|
|
208
232
|
|
|
209
233
|
/**
|
|
210
234
|
* Reset the gl transform to identity
|
|
211
235
|
* @name resetTransform
|
|
212
|
-
* @
|
|
236
|
+
* @memberof me.WebGLRenderer.prototype
|
|
213
237
|
* @function
|
|
214
238
|
*/
|
|
215
239
|
resetTransform() {
|
|
@@ -256,7 +280,7 @@ class WebGLRenderer extends Renderer {
|
|
|
256
280
|
/**
|
|
257
281
|
* Create a pattern with the specified repetition
|
|
258
282
|
* @name createPattern
|
|
259
|
-
* @
|
|
283
|
+
* @memberof me.WebGLRenderer.prototype
|
|
260
284
|
* @function
|
|
261
285
|
* @param {Image} image Source image
|
|
262
286
|
* @param {string} repeat Define how the pattern should be repeated
|
|
@@ -289,7 +313,7 @@ class WebGLRenderer extends Renderer {
|
|
|
289
313
|
/**
|
|
290
314
|
* Flush the compositor to the frame buffer
|
|
291
315
|
* @name flush
|
|
292
|
-
* @
|
|
316
|
+
* @memberof me.WebGLRenderer.prototype
|
|
293
317
|
* @function
|
|
294
318
|
*/
|
|
295
319
|
flush() {
|
|
@@ -299,23 +323,22 @@ class WebGLRenderer extends Renderer {
|
|
|
299
323
|
/**
|
|
300
324
|
* Clears the gl context with the given color.
|
|
301
325
|
* @name clearColor
|
|
302
|
-
* @
|
|
326
|
+
* @memberof me.WebGLRenderer.prototype
|
|
303
327
|
* @function
|
|
304
|
-
* @param {me.Color|string} color CSS color.
|
|
328
|
+
* @param {me.Color|string} [color="#000000"] CSS color.
|
|
305
329
|
* @param {boolean} [opaque=false] Allow transparency [default] or clear the surface completely [true]
|
|
306
330
|
*/
|
|
307
|
-
clearColor(color, opaque) {
|
|
331
|
+
clearColor(color = "#000000", opaque = false) {
|
|
308
332
|
var glArray;
|
|
309
333
|
|
|
310
|
-
this.save();
|
|
311
|
-
|
|
312
334
|
if (color instanceof Color) {
|
|
313
335
|
glArray = color.toArray();
|
|
314
336
|
} else {
|
|
337
|
+
var _color = pool.pull("me.Color");
|
|
315
338
|
// reuse temporary the renderer default color object
|
|
316
|
-
glArray =
|
|
339
|
+
glArray = _color.parseCSS(color).toArray();
|
|
340
|
+
pool.push(_color);
|
|
317
341
|
}
|
|
318
|
-
|
|
319
342
|
// clear gl context with the specified color
|
|
320
343
|
this.currentCompositor.clearColor(glArray[0], glArray[1], glArray[2], (opaque === true) ? 1.0 : glArray[3]);
|
|
321
344
|
this.currentCompositor.clear();
|
|
@@ -323,13 +346,12 @@ class WebGLRenderer extends Renderer {
|
|
|
323
346
|
// restore default clear Color black
|
|
324
347
|
this.currentCompositor.clearColor(0.0, 0.0, 0.0, 0.0);
|
|
325
348
|
|
|
326
|
-
this.restore();
|
|
327
349
|
}
|
|
328
350
|
|
|
329
351
|
/**
|
|
330
352
|
* Erase the pixels in the given rectangular area by setting them to transparent black (rgba(0,0,0,0)).
|
|
331
353
|
* @name clearRect
|
|
332
|
-
* @
|
|
354
|
+
* @memberof me.WebGLRenderer.prototype
|
|
333
355
|
* @function
|
|
334
356
|
* @param {number} x x axis of the coordinate for the rectangle starting point.
|
|
335
357
|
* @param {number} y y axis of the coordinate for the rectangle starting point.
|
|
@@ -337,11 +359,10 @@ class WebGLRenderer extends Renderer {
|
|
|
337
359
|
* @param {number} height The rectangle's height.
|
|
338
360
|
*/
|
|
339
361
|
clearRect(x, y, width, height) {
|
|
340
|
-
|
|
341
|
-
this.
|
|
342
|
-
this.
|
|
343
|
-
this.
|
|
344
|
-
pool.push(color);
|
|
362
|
+
this.save();
|
|
363
|
+
this.clipRect(x, y, width, height);
|
|
364
|
+
this.clearColor();
|
|
365
|
+
this.restore();
|
|
345
366
|
}
|
|
346
367
|
|
|
347
368
|
/**
|
|
@@ -380,7 +401,7 @@ class WebGLRenderer extends Renderer {
|
|
|
380
401
|
/**
|
|
381
402
|
* Draw an image to the gl context
|
|
382
403
|
* @name drawImage
|
|
383
|
-
* @
|
|
404
|
+
* @memberof me.WebGLRenderer.prototype
|
|
384
405
|
* @function
|
|
385
406
|
* @param {Image} image An element to draw into the context. The specification permits any canvas image source (CanvasImageSource), specifically, a CSSImageValue, an HTMLImageElement, an SVGImageElement, an HTMLVideoElement, an HTMLCanvasElement, an ImageBitmap, or an OffscreenCanvas.
|
|
386
407
|
* @param {number} sx The X coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
|
|
@@ -433,7 +454,7 @@ class WebGLRenderer extends Renderer {
|
|
|
433
454
|
/**
|
|
434
455
|
* Draw a pattern within the given rectangle.
|
|
435
456
|
* @name drawPattern
|
|
436
|
-
* @
|
|
457
|
+
* @memberof me.WebGLRenderer.prototype
|
|
437
458
|
* @function
|
|
438
459
|
* @param {me.Renderer.Texture} pattern Pattern object
|
|
439
460
|
* @param {number} x
|
|
@@ -451,7 +472,7 @@ class WebGLRenderer extends Renderer {
|
|
|
451
472
|
/**
|
|
452
473
|
* return a reference to the screen canvas corresponding WebGL Context
|
|
453
474
|
* @name getScreenContext
|
|
454
|
-
* @
|
|
475
|
+
* @memberof me.WebGLRenderer.prototype
|
|
455
476
|
* @function
|
|
456
477
|
* @returns {WebGLRenderingContext}
|
|
457
478
|
*/
|
|
@@ -462,7 +483,7 @@ class WebGLRenderer extends Renderer {
|
|
|
462
483
|
/**
|
|
463
484
|
* Returns the WebGL Context object of the given Canvas
|
|
464
485
|
* @name getContextGL
|
|
465
|
-
* @
|
|
486
|
+
* @memberof me.WebGLRenderer.prototype
|
|
466
487
|
* @function
|
|
467
488
|
* @param {HTMLCanvasElement} canvas
|
|
468
489
|
* @param {boolean} [transparent=true] use false to disable transparency
|
|
@@ -520,7 +541,7 @@ class WebGLRenderer extends Renderer {
|
|
|
520
541
|
* Returns the WebGLContext instance for the renderer
|
|
521
542
|
* return a reference to the system 2d Context
|
|
522
543
|
* @name getContext
|
|
523
|
-
* @
|
|
544
|
+
* @memberof me.WebGLRenderer.prototype
|
|
524
545
|
* @function
|
|
525
546
|
* @returns {WebGLRenderingContext}
|
|
526
547
|
*/
|
|
@@ -531,7 +552,7 @@ class WebGLRenderer extends Renderer {
|
|
|
531
552
|
/**
|
|
532
553
|
* set a blend mode for the given context
|
|
533
554
|
* @name setBlendMode
|
|
534
|
-
* @
|
|
555
|
+
* @memberof me.WebGLRenderer.prototype
|
|
535
556
|
* @function
|
|
536
557
|
* @param {string} [mode="normal"] blend mode : "normal", "multiply"
|
|
537
558
|
* @param {WebGLRenderingContext} [gl]
|
|
@@ -571,7 +592,7 @@ class WebGLRenderer extends Renderer {
|
|
|
571
592
|
/**
|
|
572
593
|
* restores the canvas context
|
|
573
594
|
* @name restore
|
|
574
|
-
* @
|
|
595
|
+
* @memberof me.WebGLRenderer.prototype
|
|
575
596
|
* @function
|
|
576
597
|
*/
|
|
577
598
|
restore() {
|
|
@@ -605,7 +626,7 @@ class WebGLRenderer extends Renderer {
|
|
|
605
626
|
/**
|
|
606
627
|
* saves the canvas context
|
|
607
628
|
* @name save
|
|
608
|
-
* @
|
|
629
|
+
* @memberof me.WebGLRenderer.prototype
|
|
609
630
|
* @function
|
|
610
631
|
*/
|
|
611
632
|
save() {
|
|
@@ -621,7 +642,7 @@ class WebGLRenderer extends Renderer {
|
|
|
621
642
|
/**
|
|
622
643
|
* rotates the uniform matrix
|
|
623
644
|
* @name rotate
|
|
624
|
-
* @
|
|
645
|
+
* @memberof me.WebGLRenderer.prototype
|
|
625
646
|
* @function
|
|
626
647
|
* @param {number} angle in radians
|
|
627
648
|
*/
|
|
@@ -632,7 +653,7 @@ class WebGLRenderer extends Renderer {
|
|
|
632
653
|
/**
|
|
633
654
|
* scales the uniform matrix
|
|
634
655
|
* @name scale
|
|
635
|
-
* @
|
|
656
|
+
* @memberof me.WebGLRenderer.prototype
|
|
636
657
|
* @function
|
|
637
658
|
* @param {number} x
|
|
638
659
|
* @param {number} y
|
|
@@ -653,7 +674,7 @@ class WebGLRenderer extends Renderer {
|
|
|
653
674
|
/**
|
|
654
675
|
* Set the global alpha
|
|
655
676
|
* @name setGlobalAlpha
|
|
656
|
-
* @
|
|
677
|
+
* @memberof me.WebGLRenderer.prototype
|
|
657
678
|
* @function
|
|
658
679
|
* @param {number} alpha 0.0 to 1.0 values accepted.
|
|
659
680
|
*/
|
|
@@ -665,7 +686,7 @@ class WebGLRenderer extends Renderer {
|
|
|
665
686
|
* Set the current fill & stroke style color.
|
|
666
687
|
* By default, or upon reset, the value is set to #000000.
|
|
667
688
|
* @name setColor
|
|
668
|
-
* @
|
|
689
|
+
* @memberof me.WebGLRenderer.prototype
|
|
669
690
|
* @function
|
|
670
691
|
* @param {me.Color|string} color css color string.
|
|
671
692
|
*/
|
|
@@ -678,7 +699,7 @@ class WebGLRenderer extends Renderer {
|
|
|
678
699
|
/**
|
|
679
700
|
* Set the line width
|
|
680
701
|
* @name setLineWidth
|
|
681
|
-
* @
|
|
702
|
+
* @memberof me.WebGLRenderer.prototype
|
|
682
703
|
* @function
|
|
683
704
|
* @param {number} width Line width
|
|
684
705
|
*/
|
|
@@ -689,7 +710,7 @@ class WebGLRenderer extends Renderer {
|
|
|
689
710
|
/**
|
|
690
711
|
* Stroke an arc at the specified coordinates with given radius, start and end points
|
|
691
712
|
* @name strokeArc
|
|
692
|
-
* @
|
|
713
|
+
* @memberof me.WebGLRenderer.prototype
|
|
693
714
|
* @function
|
|
694
715
|
* @param {number} x arc center point x-axis
|
|
695
716
|
* @param {number} y arc center point y-axis
|
|
@@ -733,7 +754,7 @@ class WebGLRenderer extends Renderer {
|
|
|
733
754
|
/**
|
|
734
755
|
* Fill an arc at the specified coordinates with given radius, start and end points
|
|
735
756
|
* @name fillArc
|
|
736
|
-
* @
|
|
757
|
+
* @memberof me.WebGLRenderer.prototype
|
|
737
758
|
* @function
|
|
738
759
|
* @param {number} x arc center point x-axis
|
|
739
760
|
* @param {number} y arc center point y-axis
|
|
@@ -776,7 +797,7 @@ class WebGLRenderer extends Renderer {
|
|
|
776
797
|
/**
|
|
777
798
|
* Stroke an ellipse at the specified coordinates with given radius
|
|
778
799
|
* @name strokeEllipse
|
|
779
|
-
* @
|
|
800
|
+
* @memberof me.WebGLRenderer.prototype
|
|
780
801
|
* @function
|
|
781
802
|
* @param {number} x ellipse center point x-axis
|
|
782
803
|
* @param {number} y ellipse center point y-axis
|
|
@@ -813,7 +834,7 @@ class WebGLRenderer extends Renderer {
|
|
|
813
834
|
/**
|
|
814
835
|
* Fill an ellipse at the specified coordinates with given radius
|
|
815
836
|
* @name fillEllipse
|
|
816
|
-
* @
|
|
837
|
+
* @memberof me.WebGLRenderer.prototype
|
|
817
838
|
* @function
|
|
818
839
|
* @param {number} x ellipse center point x-axis
|
|
819
840
|
* @param {number} y ellipse center point y-axis
|
|
@@ -848,7 +869,7 @@ class WebGLRenderer extends Renderer {
|
|
|
848
869
|
/**
|
|
849
870
|
* Stroke a line of the given two points
|
|
850
871
|
* @name strokeLine
|
|
851
|
-
* @
|
|
872
|
+
* @memberof me.WebGLRenderer.prototype
|
|
852
873
|
* @function
|
|
853
874
|
* @param {number} startX the start x coordinate
|
|
854
875
|
* @param {number} startY the start y coordinate
|
|
@@ -868,7 +889,7 @@ class WebGLRenderer extends Renderer {
|
|
|
868
889
|
/**
|
|
869
890
|
* Fill a line of the given two points
|
|
870
891
|
* @name fillLine
|
|
871
|
-
* @
|
|
892
|
+
* @memberof me.WebGLRenderer.prototype
|
|
872
893
|
* @function
|
|
873
894
|
* @param {number} startX the start x coordinate
|
|
874
895
|
* @param {number} startY the start y coordinate
|
|
@@ -882,7 +903,7 @@ class WebGLRenderer extends Renderer {
|
|
|
882
903
|
/**
|
|
883
904
|
* Stroke a me.Polygon on the screen with a specified color
|
|
884
905
|
* @name strokePolygon
|
|
885
|
-
* @
|
|
906
|
+
* @memberof me.WebGLRenderer.prototype
|
|
886
907
|
* @function
|
|
887
908
|
* @param {me.Polygon} poly the shape to draw
|
|
888
909
|
* @param {boolean} [fill=false] also fill the shape with the current color if true
|
|
@@ -912,7 +933,7 @@ class WebGLRenderer extends Renderer {
|
|
|
912
933
|
/**
|
|
913
934
|
* Fill a me.Polygon on the screen
|
|
914
935
|
* @name fillPolygon
|
|
915
|
-
* @
|
|
936
|
+
* @memberof me.WebGLRenderer.prototype
|
|
916
937
|
* @function
|
|
917
938
|
* @param {me.Polygon} poly the shape to draw
|
|
918
939
|
*/
|
|
@@ -940,7 +961,7 @@ class WebGLRenderer extends Renderer {
|
|
|
940
961
|
/**
|
|
941
962
|
* Draw a stroke rectangle at the specified coordinates
|
|
942
963
|
* @name strokeRect
|
|
943
|
-
* @
|
|
964
|
+
* @memberof me.WebGLRenderer.prototype
|
|
944
965
|
* @function
|
|
945
966
|
* @param {number} x
|
|
946
967
|
* @param {number} y
|
|
@@ -968,7 +989,7 @@ class WebGLRenderer extends Renderer {
|
|
|
968
989
|
/**
|
|
969
990
|
* Draw a filled rectangle at the specified coordinates
|
|
970
991
|
* @name fillRect
|
|
971
|
-
* @
|
|
992
|
+
* @memberof me.WebGLRenderer.prototype
|
|
972
993
|
* @function
|
|
973
994
|
* @param {number} x
|
|
974
995
|
* @param {number} y
|
|
@@ -992,7 +1013,7 @@ class WebGLRenderer extends Renderer {
|
|
|
992
1013
|
* Reset (overrides) the renderer transformation matrix to the
|
|
993
1014
|
* identity one, and then apply the given transformation matrix.
|
|
994
1015
|
* @name setTransform
|
|
995
|
-
* @
|
|
1016
|
+
* @memberof me.WebGLRenderer.prototype
|
|
996
1017
|
* @function
|
|
997
1018
|
* @param {me.Matrix2d} mat2d Matrix to transform by
|
|
998
1019
|
*/
|
|
@@ -1004,7 +1025,7 @@ class WebGLRenderer extends Renderer {
|
|
|
1004
1025
|
/**
|
|
1005
1026
|
* Multiply given matrix into the renderer tranformation matrix
|
|
1006
1027
|
* @name transform
|
|
1007
|
-
* @
|
|
1028
|
+
* @memberof me.WebGLRenderer.prototype
|
|
1008
1029
|
* @function
|
|
1009
1030
|
* @param {me.Matrix2d} mat2d Matrix to transform by
|
|
1010
1031
|
*/
|
|
@@ -1022,7 +1043,7 @@ class WebGLRenderer extends Renderer {
|
|
|
1022
1043
|
/**
|
|
1023
1044
|
* Translates the uniform matrix by the given coordinates
|
|
1024
1045
|
* @name translate
|
|
1025
|
-
* @
|
|
1046
|
+
* @memberof me.WebGLRenderer.prototype
|
|
1026
1047
|
* @function
|
|
1027
1048
|
* @param {number} x
|
|
1028
1049
|
* @param {number} y
|
|
@@ -1045,7 +1066,7 @@ class WebGLRenderer extends Renderer {
|
|
|
1045
1066
|
* and restore it (with the restore() method) any time in the future.
|
|
1046
1067
|
* (<u>this is an experimental feature !</u>)
|
|
1047
1068
|
* @name clipRect
|
|
1048
|
-
* @
|
|
1069
|
+
* @memberof me.WebGLRenderer.prototype
|
|
1049
1070
|
* @function
|
|
1050
1071
|
* @param {number} x
|
|
1051
1072
|
* @param {number} y
|
|
@@ -1093,7 +1114,7 @@ class WebGLRenderer extends Renderer {
|
|
|
1093
1114
|
* So, if the renderable is larger than the mask, only the intersecting part of the renderable will be visible.
|
|
1094
1115
|
* Mask are not preserved through renderer context save and restore.
|
|
1095
1116
|
* @name setMask
|
|
1096
|
-
* @
|
|
1117
|
+
* @memberof me.WebGLRenderer.prototype
|
|
1097
1118
|
* @function
|
|
1098
1119
|
* @param {me.Rect|me.Polygon|me.Line|me.Ellipse} [mask] the shape defining the mask to be applied
|
|
1099
1120
|
*/
|
|
@@ -1125,7 +1146,7 @@ class WebGLRenderer extends Renderer {
|
|
|
1125
1146
|
* disable (remove) the rendering mask set through setMask.
|
|
1126
1147
|
* @name clearMask
|
|
1127
1148
|
* @see me.WebGLRenderer#setMask
|
|
1128
|
-
* @
|
|
1149
|
+
* @memberof me.WebGLRenderer.prototype
|
|
1129
1150
|
* @function
|
|
1130
1151
|
*/
|
|
1131
1152
|
clearMask() {
|