melonjs 10.1.1 → 10.2.3

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 (92) hide show
  1. package/README.md +6 -10
  2. package/dist/melonjs.js +3114 -2866
  3. package/dist/melonjs.min.js +3 -3
  4. package/dist/melonjs.module.d.ts +2588 -2498
  5. package/dist/melonjs.module.js +2694 -2479
  6. package/package.json +10 -11
  7. package/src/audio/audio.js +43 -43
  8. package/src/camera/camera2d.js +52 -74
  9. package/src/entity/draggable.js +18 -17
  10. package/src/entity/droptarget.js +19 -18
  11. package/src/entity/entity.js +22 -26
  12. package/src/game.js +3 -3
  13. package/src/index.js +15 -11
  14. package/src/input/gamepad.js +13 -13
  15. package/src/input/input.js +1 -1
  16. package/src/input/keyboard.js +14 -16
  17. package/src/input/pointer.js +42 -35
  18. package/src/input/pointerevent.js +25 -33
  19. package/src/lang/deprecated.js +3 -3
  20. package/src/level/level.js +24 -16
  21. package/src/level/tiled/TMXGroup.js +6 -6
  22. package/src/level/tiled/TMXLayer.js +31 -31
  23. package/src/level/tiled/TMXObject.js +19 -19
  24. package/src/level/tiled/TMXTile.js +11 -12
  25. package/src/level/tiled/TMXTileMap.js +23 -21
  26. package/src/level/tiled/TMXTileset.js +13 -13
  27. package/src/level/tiled/TMXTilesetGroup.js +4 -4
  28. package/src/level/tiled/TMXUtils.js +13 -11
  29. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +1 -1
  30. package/src/level/tiled/renderer/TMXIsometricRenderer.js +1 -1
  31. package/src/level/tiled/renderer/TMXRenderer.js +17 -17
  32. package/src/loader/loader.js +31 -27
  33. package/src/loader/loadingscreen.js +44 -75
  34. package/src/math/color.js +45 -64
  35. package/src/math/math.js +17 -17
  36. package/src/math/matrix2.js +46 -46
  37. package/src/math/matrix3.js +64 -64
  38. package/src/math/observable_vector2.js +45 -57
  39. package/src/math/observable_vector3.js +56 -70
  40. package/src/math/vector2.js +60 -59
  41. package/src/math/vector3.js +65 -64
  42. package/src/particles/emitter.js +53 -55
  43. package/src/particles/particle.js +1 -1
  44. package/src/physics/body.js +45 -51
  45. package/src/physics/bounds.js +36 -36
  46. package/src/physics/collision.js +15 -16
  47. package/src/physics/detector.js +10 -11
  48. package/src/physics/quadtree.js +18 -16
  49. package/src/physics/sat.js +17 -17
  50. package/src/physics/world.js +12 -10
  51. package/src/plugin/plugin.js +6 -6
  52. package/src/renderable/GUI.js +13 -18
  53. package/src/renderable/collectable.js +3 -3
  54. package/src/renderable/colorlayer.js +4 -4
  55. package/src/renderable/container.js +64 -46
  56. package/src/renderable/imagelayer.js +30 -31
  57. package/src/renderable/nineslicesprite.js +158 -69
  58. package/src/renderable/renderable.js +68 -67
  59. package/src/renderable/sprite.js +57 -43
  60. package/src/renderable/trigger.js +14 -15
  61. package/src/shapes/ellipse.js +27 -26
  62. package/src/shapes/line.js +8 -7
  63. package/src/shapes/poly.js +33 -31
  64. package/src/shapes/rectangle.js +50 -96
  65. package/src/state/stage.js +8 -8
  66. package/src/state/state.js +56 -56
  67. package/src/system/device.js +97 -84
  68. package/src/system/event.js +72 -72
  69. package/src/system/pooling.js +14 -14
  70. package/src/system/save.js +6 -3
  71. package/src/system/timer.js +20 -20
  72. package/src/text/bitmaptext.js +27 -33
  73. package/src/text/bitmaptextdata.js +9 -9
  74. package/src/text/text.js +118 -59
  75. package/src/tweens/easing.js +4 -4
  76. package/src/tweens/interpolation.js +4 -4
  77. package/src/tweens/tween.js +37 -27
  78. package/src/utils/agent.js +9 -8
  79. package/src/utils/array.js +4 -4
  80. package/src/utils/file.js +4 -4
  81. package/src/utils/function.js +5 -5
  82. package/src/utils/string.js +12 -12
  83. package/src/utils/utils.js +19 -19
  84. package/src/video/canvas/canvas_renderer.js +90 -90
  85. package/src/video/renderer.js +40 -39
  86. package/src/video/texture.js +85 -76
  87. package/src/video/texture_cache.js +11 -0
  88. package/src/video/video.js +31 -31
  89. package/src/video/webgl/buffer/vertex.js +9 -1
  90. package/src/video/webgl/glshader.js +20 -20
  91. package/src/video/webgl/webgl_compositor.js +47 -46
  92. package/src/video/webgl/webgl_renderer.js +104 -104
package/README.md CHANGED
@@ -31,7 +31,7 @@ Graphics
31
31
  - 2D sprite-based graphic engine
32
32
  - Fast WebGL 1 & 2 renderer for desktop and mobile devices with fallback to Canvas rendering
33
33
  - High DPI resolution & Canvas advanced auto scaling
34
- - Sprite with Animation management
34
+ - Sprite with 9-slice scaling option, and animation management
35
35
  - built-in effects such as tinting and masking
36
36
  - Standard spritesheet, single and multiple Packed Textures support
37
37
  - System & Bitmap Text
@@ -90,10 +90,10 @@ Tools integration and usage with melonJS is documented in our [Wiki](https://git
90
90
  Using melonJS
91
91
  -------------------------------------------------------------------------------
92
92
 
93
- Basic Example
93
+ Basic [Hello World](https://jsfiddle.net/obiot/4o9f02tc/) Example
94
94
 
95
95
  ```JavaScript
96
- import * as me from "https://cdn.jsdelivr.net/npm/melonjs/dist/melonjs.module.js";
96
+ import * as me from "https://esm.run/melonjs";
97
97
 
98
98
  me.device.onReady(function () {
99
99
  // initialize the display canvas once the device/browser is ready
@@ -170,15 +170,11 @@ If you need to import the ES6 module of melonjs (e.g. for Webpack):
170
170
  Or can simply be added to your html, using [jsDeliver](https://www.jsdelivr.com/package/npm/melonjs) content delivery network (CDN) :
171
171
 
172
172
  ```html
173
- <!-- load the ES5 UMD bundle of melonJS v10.0.0 -->
174
- <script src="https://cdn.jsdelivr.net/npm/melonjs@10.0.0/dist/melonjs.js"></script>
175
- <!-- load the ES6 module bundle of melonJS v10.0.0 -->
176
- <script src="https://cdn.jsdelivr.net/npm/melonjs@10.0.0/dist/melonjs.module.js"></script>
173
+ <!-- load the ES6 module bundle of melonJS v10.0 -->
174
+ <script src="https://esm.run/melonjs@10.0"></script>
177
175
  <!-- omit the version completely to get the latest one -->
178
176
  <!-- you should NOT use this in production -->
179
- <script src="https://cdn.jsdelivr.net/npm/melonjs/dist/melonjs.js"></script>
180
- <!-- add ".min" to any JS/CSS file to get a minified version -->
181
- <script src="https://cdn.jsdelivr.net/npm/melonjs@10.0.0/dist/melonjs.min.js"></script>
177
+ <script src="https://esm.run/melonjs"></script>
182
178
  ```
183
179
  > Note: starting from the 10.0.0 version, the debug plugin is no longer provided as part of the melonJS library release, and has been moved to the official [boilerplate](https://github.com/melonjs/es6-boilerplate)
184
180