melonjs 10.2.0 → 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.
Files changed (95) hide show
  1. package/README.md +1 -1
  2. package/dist/melonjs.js +4435 -4283
  3. package/dist/melonjs.min.js +4 -4
  4. package/dist/melonjs.module.d.ts +3348 -3833
  5. package/dist/melonjs.module.js +4025 -3920
  6. package/package.json +13 -14
  7. package/src/audio/audio.js +45 -45
  8. package/src/camera/camera2d.js +78 -101
  9. package/src/entity/draggable.js +21 -29
  10. package/src/entity/droptarget.js +24 -31
  11. package/src/entity/entity.js +34 -38
  12. package/src/game.js +8 -8
  13. package/src/{shapes → geometries}/ellipse.js +46 -46
  14. package/src/{shapes → geometries}/line.js +14 -14
  15. package/src/{shapes → geometries}/poly.js +103 -54
  16. package/src/{shapes → geometries}/rectangle.js +73 -120
  17. package/src/index.js +18 -19
  18. package/src/input/gamepad.js +20 -20
  19. package/src/input/input.js +3 -3
  20. package/src/input/keyboard.js +122 -124
  21. package/src/input/pointer.js +102 -62
  22. package/src/input/pointerevent.js +97 -42
  23. package/src/lang/deprecated.js +29 -18
  24. package/src/level/level.js +34 -26
  25. package/src/level/tiled/TMXGroup.js +12 -13
  26. package/src/level/tiled/TMXLayer.js +41 -42
  27. package/src/level/tiled/TMXObject.js +76 -70
  28. package/src/level/tiled/TMXTile.js +13 -15
  29. package/src/level/tiled/TMXTileMap.js +26 -25
  30. package/src/level/tiled/TMXTileset.js +14 -15
  31. package/src/level/tiled/TMXTilesetGroup.js +5 -6
  32. package/src/level/tiled/TMXUtils.js +13 -11
  33. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +3 -4
  34. package/src/level/tiled/renderer/TMXIsometricRenderer.js +3 -4
  35. package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +2 -3
  36. package/src/level/tiled/renderer/TMXRenderer.js +18 -19
  37. package/src/level/tiled/renderer/TMXStaggeredRenderer.js +2 -3
  38. package/src/loader/loader.js +46 -40
  39. package/src/loader/loadingscreen.js +7 -7
  40. package/src/math/color.js +68 -88
  41. package/src/math/math.js +33 -33
  42. package/src/math/matrix2.js +70 -71
  43. package/src/math/matrix3.js +90 -91
  44. package/src/math/observable_vector2.js +91 -92
  45. package/src/math/observable_vector3.js +110 -106
  46. package/src/math/vector2.js +116 -104
  47. package/src/math/vector3.js +129 -110
  48. package/src/particles/emitter.js +116 -126
  49. package/src/particles/particle.js +4 -5
  50. package/src/particles/particlecontainer.js +2 -3
  51. package/src/physics/body.js +82 -83
  52. package/src/physics/bounds.js +64 -66
  53. package/src/physics/collision.js +21 -22
  54. package/src/physics/detector.js +13 -13
  55. package/src/physics/quadtree.js +26 -25
  56. package/src/physics/sat.js +21 -21
  57. package/src/physics/world.js +23 -22
  58. package/src/plugin/plugin.js +12 -13
  59. package/src/renderable/GUI.js +20 -26
  60. package/src/renderable/collectable.js +6 -7
  61. package/src/renderable/colorlayer.js +11 -12
  62. package/src/renderable/container.js +98 -81
  63. package/src/renderable/imagelayer.js +33 -35
  64. package/src/renderable/nineslicesprite.js +15 -16
  65. package/src/renderable/renderable.js +112 -111
  66. package/src/renderable/sprite.js +71 -58
  67. package/src/renderable/trigger.js +17 -19
  68. package/src/state/stage.js +14 -15
  69. package/src/state/state.js +78 -78
  70. package/src/system/device.js +137 -180
  71. package/src/system/event.js +116 -104
  72. package/src/system/pooling.js +15 -15
  73. package/src/system/save.js +9 -6
  74. package/src/system/timer.js +33 -33
  75. package/src/text/bitmaptext.js +39 -46
  76. package/src/text/bitmaptextdata.js +14 -15
  77. package/src/text/text.js +55 -58
  78. package/src/tweens/easing.js +5 -5
  79. package/src/tweens/interpolation.js +5 -5
  80. package/src/tweens/tween.js +49 -40
  81. package/src/utils/agent.js +12 -11
  82. package/src/utils/array.js +8 -8
  83. package/src/utils/file.js +7 -7
  84. package/src/utils/function.js +8 -8
  85. package/src/utils/string.js +19 -19
  86. package/src/utils/utils.js +23 -23
  87. package/src/video/canvas/canvas_renderer.js +127 -128
  88. package/src/video/renderer.js +69 -69
  89. package/src/video/texture.js +80 -82
  90. package/src/video/texture_cache.js +2 -4
  91. package/src/video/video.js +38 -38
  92. package/src/video/webgl/buffer/vertex.js +11 -3
  93. package/src/video/webgl/glshader.js +31 -32
  94. package/src/video/webgl/webgl_compositor.js +145 -127
  95. package/src/video/webgl/webgl_renderer.js +196 -175
@@ -76,6 +76,9 @@ function setTMXValue(name, type, value) {
76
76
  return value;
77
77
  }
78
78
 
79
+ /**
80
+ * @ignore
81
+ */
79
82
  function parseAttributes(obj, elt) {
80
83
  // do attributes
81
84
  if (elt.attributes && elt.attributes.length > 0) {
@@ -97,9 +100,8 @@ function parseAttributes(obj, elt) {
97
100
  * @ignore
98
101
  * @function
99
102
  * @name decompress
100
- * @param {Number[]} data Array of bytes
101
- * @param {String} format compressed data format ("gzip","zlib")
102
- * @return {Number[]} Decompressed data
103
+ * @param {number[]} data Array of bytes
104
+ * @param {string} format compressed data format ("gzip","zlib")
103
105
  */
104
106
  export function decompress() {
105
107
  throw new Error("GZIP/ZLIB compressed TMX Tile Map not supported!");
@@ -110,8 +112,8 @@ export function decompress() {
110
112
  * @ignore
111
113
  * @function
112
114
  * @name decodeCSV
113
- * @param {String} input CSV formatted data (only numbers, everything else will be converted to NaN)
114
- * @return {Number[]} Decoded data
115
+ * @param {string} input CSV formatted data (only numbers, everything else will be converted to NaN)
116
+ * @returns {number[]} Decoded data
115
117
  */
116
118
  export function decodeCSV(input) {
117
119
  var entries = input.replace("\n", "").trim().split(",");
@@ -128,9 +130,9 @@ export function decodeCSV(input) {
128
130
  * @ignore
129
131
  * @function
130
132
  * @name decodeBase64AsArray
131
- * @param {String} input Base64 encoded data
132
- * @param {Number} [bytes] number of bytes per array entry
133
- * @return {Uint32Array} Decoded data
133
+ * @param {string} input Base64 encoded data
134
+ * @param {number} [bytes] number of bytes per array entry
135
+ * @returns {Uint32Array} Decoded data
134
136
  */
135
137
  export function decodeBase64AsArray(input, bytes) {
136
138
  bytes = bytes || 1;
@@ -149,9 +151,9 @@ export function decodeBase64AsArray(input, bytes) {
149
151
  };
150
152
 
151
153
  /**
152
- * Decode the given data
153
- * @ignore
154
- */
154
+ * Decode the given data
155
+ * @ignore
156
+ */
155
157
  export function decode(data, encoding, compression) {
156
158
  compression = compression || "none";
157
159
  encoding = encoding || "none";
@@ -23,9 +23,8 @@ var offsetsStaggerY = [
23
23
  * @classdesc
24
24
  * an Hexagonal Map Renderder
25
25
  * @class TMXHexagonalRenderer
26
- * @memberOf me
27
- * @extends me.TMXRenderer
28
- * @constructor
26
+ * @memberof me
27
+ * @augments me.TMXRenderer
29
28
  * @param {me.TMXTileMap} map the TMX map
30
29
  */
31
30
  class TMXHexagonalRenderer extends TMXRenderer {
@@ -85,7 +84,7 @@ class TMXHexagonalRenderer extends TMXRenderer {
85
84
  * @public
86
85
  * @function
87
86
  * @param {me.TMXLayer} [layer] calculate the bounding rect for a specific layer (will return a new bounds object)
88
- * @return {me.Bounds}
87
+ * @returns {me.Bounds}
89
88
  */
90
89
  getBounds(layer) {
91
90
  var bounds = layer instanceof TMXLayer ? pool.pull("Bounds") : this.bounds;
@@ -8,9 +8,8 @@ import TMXLayer from "./../TMXLayer.js";
8
8
  * @classdesc
9
9
  * an Isometric Map Renderder
10
10
  * @class TMXIsometricRenderer
11
- * @memberOf me
12
- * @extends me.TMXRenderer
13
- * @constructor
11
+ * @memberof me
12
+ * @augments me.TMXRenderer
14
13
  * @param {me.TMXTileMap} map the TMX map
15
14
  */
16
15
  class TMXIsometricRenderer extends TMXRenderer {
@@ -45,7 +44,7 @@ class TMXIsometricRenderer extends TMXRenderer {
45
44
  * @public
46
45
  * @function
47
46
  * @param {me.TMXLayer} [layer] calculate the bounding rect for a specific layer (will return a new bounds object)
48
- * @return {me.Bounds}
47
+ * @returns {me.Bounds}
49
48
  */
50
49
  getBounds(layer) {
51
50
  var bounds = layer instanceof TMXLayer ? pool.pull("Bounds") : this.bounds;
@@ -6,9 +6,8 @@ import TMXRenderer from "./TMXRenderer.js";
6
6
  * @classdesc
7
7
  * an Orthogonal Map Renderder
8
8
  * @class TMXOrthogonalRenderer
9
- * @memberOf me
10
- * @extends me.TMXRenderer
11
- * @constructor
9
+ * @memberof me
10
+ * @augments me.TMXRenderer
12
11
  * @param {me.TMXTileMap} map the TMX map
13
12
  */
14
13
  class TMXOrthogonalRenderer extends TMXRenderer {
@@ -8,12 +8,11 @@ import Bounds from "./../../../physics/Bounds.js";
8
8
  * @classdesc
9
9
  * The map renderer base class
10
10
  * @class TMXRenderer
11
- * @memberOf me
12
- * @constructor
13
- * @param {Number} cols width of the tilemap in tiles
14
- * @param {Number} rows height of the tilemap in tiles
15
- * @param {Number} tilewidth width of each tile in pixels
16
- * @param {Number} tileheight height of each tile in pixels
11
+ * @memberof me
12
+ * @param {number} cols width of the tilemap in tiles
13
+ * @param {number} rows height of the tilemap in tiles
14
+ * @param {number} tilewidth width of each tile in pixels
15
+ * @param {number} tileheight height of each tile in pixels
17
16
  */
18
17
  class TMXRenderer {
19
18
 
@@ -31,7 +30,7 @@ class TMXRenderer {
31
30
  * @public
32
31
  * @function
33
32
  * @param {me.TMXTileMap|me.TMXLayer} component TMX Map or Layer
34
- * @return {boolean}
33
+ * @returns {boolean}
35
34
  */
36
35
  canRender(component) {
37
36
  return (
@@ -52,7 +51,7 @@ class TMXRenderer {
52
51
  * @public
53
52
  * @function
54
53
  * @param {me.TMXLayer} [layer] calculate the bounding rect for a specific layer (will return a new bounds object)
55
- * @return {me.Bounds}
54
+ * @returns {me.Bounds}
56
55
  */
57
56
  getBounds(layer) {
58
57
  var bounds = layer instanceof TMXLayer ? pool.pull("Bounds") : this.bounds;
@@ -69,10 +68,10 @@ class TMXRenderer {
69
68
  * @name me.TMXRenderer#pixelToTileCoords
70
69
  * @public
71
70
  * @function
72
- * @param {Number} x X coordinate
73
- * @param {Number} y Y coordinate
74
- * @param {me.Vector2d} [vector] an optional vector object where to put the return values
75
- * @return {me.Vector2d}
71
+ * @param {number} x X coordinate
72
+ * @param {number} y Y coordinate
73
+ * @param {me.Vector2d} [v] an optional vector object where to put the return values
74
+ * @returns {me.Vector2d}
76
75
  */
77
76
  pixelToTileCoords(x, y, v) {
78
77
  return v;
@@ -83,12 +82,12 @@ class TMXRenderer {
83
82
  * @name me.TMXRenderer#tileToPixelCoords
84
83
  * @public
85
84
  * @function
86
- * @param {Number} col tile horizontal position
87
- * @param {Number} row tile vertical position
88
- * @param {me.Vector2d} [vector] an optional vector object where to put the return values
89
- * @return {me.Vector2d}
85
+ * @param {number} col tile horizontal position
86
+ * @param {number} row tile vertical position
87
+ * @param {me.Vector2d} [v] an optional vector object where to put the return values
88
+ * @returns {me.Vector2d}
90
89
  */
91
- tileToPixelCoords(x, y, v) {
90
+ tileToPixelCoords(col, row, v) {
92
91
  return v;
93
92
  }
94
93
 
@@ -98,8 +97,8 @@ class TMXRenderer {
98
97
  * @public
99
98
  * @function
100
99
  * @param {me.CanvasRenderer|me.WebGLRenderer} renderer a renderer object
101
- * @param {Number} x X coordinate where to draw the tile
102
- * @param {Number} y Y coordinate where to draw the tile
100
+ * @param {number} x X coordinate where to draw the tile
101
+ * @param {number} y Y coordinate where to draw the tile
103
102
  * @param {me.Tile} tile the tile object to draw
104
103
  */
105
104
  drawTile(renderer, x, y, tile) {
@@ -8,9 +8,8 @@ import { degToRad } from "./../../../math/math.js";
8
8
  * @classdesc
9
9
  * a Staggered Map Renderder
10
10
  * @class TMXStaggeredRenderer
11
- * @memberOf me
12
- * @extends me.TMXHexagonalRenderer
13
- * @constructor
11
+ * @memberof me
12
+ * @augments me.TMXHexagonalRenderer
14
13
  * @param {me.TMXTileMap} map the TMX map
15
14
  */
16
15
  class TMXStaggeredRenderer extends TMXHexagonalRenderer {
@@ -102,6 +102,9 @@ function preloadFontFace(data, onload, onerror) {
102
102
  * @ignore
103
103
  */
104
104
  function preloadTMX(tmxData, onload, onerror) {
105
+ /**
106
+ * @ignore
107
+ */
105
108
  function addToTMXList(data) {
106
109
  // set the TMX content
107
110
  tmxList[tmxData.name] = data;
@@ -291,7 +294,7 @@ function preloadJavascript(data, onload, onerror) {
291
294
  /**
292
295
  * a small class to manage loading of stuff and manage resources
293
296
  * @namespace loader
294
- * @memberOf me
297
+ * @memberof me
295
298
  */
296
299
  var loader = {
297
300
 
@@ -310,7 +313,7 @@ var loader = {
310
313
  * @public
311
314
  * @function
312
315
  * @name onload
313
- * @memberOf me.loader
316
+ * @memberof me.loader
314
317
  * @example
315
318
  * // set a callback when everything is loaded
316
319
  * me.loader.onload = this.loaded.bind(this);
@@ -324,7 +327,7 @@ var loader = {
324
327
  * @public
325
328
  * @function
326
329
  * @name onProgress
327
- * @memberOf me.loader
330
+ * @memberof me.loader
328
331
  * @example
329
332
  * // set a callback for progress notification
330
333
  * me.loader.onProgress = this.updateProgress.bind(this);
@@ -337,10 +340,10 @@ var loader = {
337
340
  * The "anonymous" keyword means that there will be no exchange of user credentials via cookies,
338
341
  * client-side SSL certificates or HTTP authentication as described in the Terminology section of the CORS specification.<br>
339
342
  * @public
340
- * @type String
343
+ * @type {string}
341
344
  * @name crossOrigin
342
345
  * @default undefined
343
- * @memberOf me.loader
346
+ * @memberof me.loader
344
347
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes
345
348
  * @example
346
349
  * // allow for cross-origin texture loading in WebGL
@@ -355,10 +358,10 @@ var loader = {
355
358
  * indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies,
356
359
  * authorization headers or TLS client certificates. Setting withCredentials has no effect on same-site requests.
357
360
  * @public
358
- * @type Boolean
361
+ * @type {boolean}
359
362
  * @name withCredentials
360
363
  * @default false
361
- * @memberOf me.loader
364
+ * @memberof me.loader
362
365
  * @see https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials
363
366
  * @example
364
367
  * // enable withCredentials
@@ -408,11 +411,11 @@ var loader = {
408
411
  * change the default baseURL for the given asset type.<br>
409
412
  * (this will prepend the asset URL and must finish with a '/')
410
413
  * @name setBaseURL
411
- * @memberOf me.loader
414
+ * @memberof me.loader
412
415
  * @public
413
416
  * @function
414
- * @param {String} type "*", "audio", binary", "image", "json", "js", "tmx", "tsx"
415
- * @param {String} [url="./"] default base URL
417
+ * @param {string} type "*", "audio", binary", "image", "json", "js", "tmx", "tsx"
418
+ * @param {string} [url="./"] default base URL
416
419
  * @example
417
420
  * // change the base URL relative address for audio assets
418
421
  * me.loader.setBaseURL("audio", "data/audio/");
@@ -439,15 +442,15 @@ var loader = {
439
442
  /**
440
443
  * set all the specified game resources to be preloaded.
441
444
  * @name preload
442
- * @memberOf me.loader
445
+ * @memberof me.loader
443
446
  * @public
444
447
  * @function
445
- * @param {Object[]} resources
446
- * @param {String} resources.name internal name of the resource
447
- * @param {String} resources.type "audio", binary", "image", "json","js", "tmx", "tsx", "fontface"
448
- * @param {String} resources.src path and/or file name of the resource (for audio assets only the path is required)
449
- * @param {Boolean} [resources.stream] Set to true to force HTML5 Audio, which allows not to wait for large file to be downloaded before playing.
450
- * @param {function} [onload=me.loader.onload] function to be called when all resources are loaded
448
+ * @param {object[]} res
449
+ * @param {string} res.name internal name of the resource
450
+ * @param {string} res.type "audio", binary", "image", "json","js", "tmx", "tsx", "fontface"
451
+ * @param {string} res.src path and/or file name of the resource (for audio assets only the path is required)
452
+ * @param {boolean} [res.stream] Set to true to force HTML5 Audio, which allows not to wait for large file to be downloaded before playing.
453
+ * @param {Function} [onload=me.loader.onload] function to be called when all resources are loaded
451
454
  * @param {boolean} [switchToLoadState=true] automatically switch to the loading screen
452
455
  * @example
453
456
  * game_resources = [
@@ -504,16 +507,17 @@ var loader = {
504
507
  /**
505
508
  * Load a single resource (to be used if you need to load additional resource during the game)
506
509
  * @name load
507
- * @memberOf me.loader
510
+ * @memberof me.loader
508
511
  * @public
509
512
  * @function
510
- * @param {Object} resource
511
- * @param {String} resource.name internal name of the resource
512
- * @param {String} resource.type "audio", binary", "image", "json", "tmx", "tsx"
513
- * @param {String} resource.src path and/or file name of the resource (for audio assets only the path is required)
514
- * @param {Boolean} [resource.stream] Set to true to force HTML5 Audio, which allows not to wait for large file to be downloaded before playing.
513
+ * @param {object} res
514
+ * @param {string} res.name internal name of the resource
515
+ * @param {string} res.type "audio", binary", "image", "json", "tmx", "tsx"
516
+ * @param {string} res.src path and/or file name of the resource (for audio assets only the path is required)
517
+ * @param {boolean} [res.stream] Set to true to force HTML5 Audio, which allows not to wait for large file to be downloaded before playing.
515
518
  * @param {Function} onload function to be called when the resource is loaded
516
519
  * @param {Function} onerror function to be called in case of error
520
+ * @returns {number} the amount of corresponding resource to be preloaded
517
521
  * @example
518
522
  * // load an image asset
519
523
  * me.loader.load({name: "avatar", type:"image", src: "data/avatar.png"}, this.onload.bind(this), this.onerror.bind(this));
@@ -573,12 +577,14 @@ var loader = {
573
577
  /**
574
578
  * unload specified resource to free memory
575
579
  * @name unload
576
- * @memberOf me.loader
580
+ * @memberof me.loader
577
581
  * @public
578
582
  * @function
579
- * @param {Object} resource
580
- * @return {Boolean} true if unloaded
581
- * @example me.loader.unload({name: "avatar", type:"image", src: "data/avatar.png"});
583
+ * @param {object} res
584
+ * @param {string} res.name internal name of the resource
585
+ * @param {string} res.type "audio", binary", "image", "json", "tmx", "tsx"
586
+ * @returns {boolean} true if unloaded
587
+ * @example me.loader.unload({name: "avatar", type:"image"});
582
588
  */
583
589
  unload(res) {
584
590
  switch (res.type) {
@@ -633,7 +639,7 @@ var loader = {
633
639
  /**
634
640
  * unload all resources to free memory
635
641
  * @name unloadAll
636
- * @memberOf me.loader
642
+ * @memberof me.loader
637
643
  * @public
638
644
  * @function
639
645
  * @example me.loader.unloadAll();
@@ -688,11 +694,11 @@ var loader = {
688
694
  /**
689
695
  * return the specified TMX/TSX object
690
696
  * @name getTMX
691
- * @memberOf me.loader
697
+ * @memberof me.loader
692
698
  * @public
693
699
  * @function
694
- * @param {String} tmx name of the tmx/tsx element ("map1");
695
- * @return {XML|Object} requested element or null if not found
700
+ * @param {string} elt name of the tmx/tsx element ("map1");
701
+ * @returns {object} requested element or null if not found
696
702
  */
697
703
  getTMX(elt) {
698
704
  // force as string
@@ -706,11 +712,11 @@ var loader = {
706
712
  /**
707
713
  * return the specified Binary object
708
714
  * @name getBinary
709
- * @memberOf me.loader
715
+ * @memberof me.loader
710
716
  * @public
711
717
  * @function
712
- * @param {String} name of the binary object ("ymTrack");
713
- * @return {Object} requested element or null if not found
718
+ * @param {string} elt name of the binary object ("ymTrack");
719
+ * @returns {object} requested element or null if not found
714
720
  */
715
721
  getBinary(elt) {
716
722
  // force as string
@@ -724,11 +730,11 @@ var loader = {
724
730
  /**
725
731
  * return the specified Image Object
726
732
  * @name getImage
727
- * @memberOf me.loader
733
+ * @memberof me.loader
728
734
  * @public
729
735
  * @function
730
- * @param {String} image name of the Image element ("tileset-platformer");
731
- * @return {HTMLImageElement} requested element or null if not found
736
+ * @param {string} image name of the Image element ("tileset-platformer");
737
+ * @returns {HTMLImageElement} requested element or null if not found
732
738
  */
733
739
  getImage(image) {
734
740
  // force as string and extract the base name
@@ -743,11 +749,11 @@ var loader = {
743
749
  /**
744
750
  * return the specified JSON Object
745
751
  * @name getJSON
746
- * @memberOf me.loader
752
+ * @memberof me.loader
747
753
  * @public
748
754
  * @function
749
- * @param {String} Name for the json file to load
750
- * @return {Object}
755
+ * @param {string} elt name of the json file to load
756
+ * @returns {object}
751
757
  */
752
758
  getJSON(elt) {
753
759
  // force as string
@@ -71,9 +71,10 @@ class IconLogo extends Renderable {
71
71
  super(x, y, 100, 85);
72
72
 
73
73
  this.iconCanvas = createCanvas(
74
- nextPowerOfTwo(this.width),
75
- nextPowerOfTwo(this.height),
76
- false);
74
+ renderer.WebGLVersion > 1 ? this.width : nextPowerOfTwo(this.width),
75
+ renderer.WebGLVersion > 1 ? this.height : nextPowerOfTwo(this.height),
76
+ false
77
+ );
77
78
 
78
79
  var context = renderer.getContext2d(this.iconCanvas);
79
80
 
@@ -117,9 +118,8 @@ class IconLogo extends Renderable {
117
118
 
118
119
  /**
119
120
  * a default loading screen
120
- * @memberOf me
121
+ * @memberof me
121
122
  * @ignore
122
- * @constructor
123
123
  */
124
124
  class DefaultLoadingScreen extends Stage {
125
125
  /**
@@ -156,7 +156,7 @@ class DefaultLoadingScreen extends Stage {
156
156
  textAlign: "left",
157
157
  textBaseline : "top",
158
158
  text: "melon",
159
- offScreenCanvas: true
159
+ offScreenCanvas: renderer.WebGLVersion >= 1
160
160
  }
161
161
  );
162
162
  logo1.anchorPoint.set(0, 0);
@@ -171,7 +171,7 @@ class DefaultLoadingScreen extends Stage {
171
171
  textBaseline : "top",
172
172
  bold: true,
173
173
  text: "JS",
174
- offScreenCanvas: true
174
+ offScreenCanvas: renderer.WebGLVersion >= 1
175
175
  }
176
176
  );
177
177
  logo2.anchorPoint.set(0, 0);