melonjs 10.1.0 → 10.2.2
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 +6 -12
- package/dist/melonjs.js +3119 -2857
- package/dist/melonjs.min.js +3 -3
- package/dist/melonjs.module.d.ts +2590 -2490
- package/dist/melonjs.module.js +2698 -2470
- package/package.json +10 -11
- package/src/audio/audio.js +43 -43
- package/src/camera/camera2d.js +55 -77
- package/src/entity/draggable.js +18 -17
- package/src/entity/droptarget.js +19 -18
- package/src/entity/entity.js +22 -26
- package/src/game.js +3 -3
- package/src/index.js +15 -11
- package/src/input/gamepad.js +13 -13
- package/src/input/input.js +1 -1
- package/src/input/keyboard.js +14 -16
- package/src/input/pointer.js +42 -35
- package/src/input/pointerevent.js +25 -33
- package/src/lang/deprecated.js +3 -3
- package/src/level/level.js +24 -16
- package/src/level/tiled/TMXGroup.js +6 -6
- package/src/level/tiled/TMXLayer.js +31 -31
- package/src/level/tiled/TMXObject.js +19 -19
- package/src/level/tiled/TMXTile.js +11 -12
- package/src/level/tiled/TMXTileMap.js +23 -21
- package/src/level/tiled/TMXTileset.js +13 -13
- package/src/level/tiled/TMXTilesetGroup.js +4 -4
- package/src/level/tiled/TMXUtils.js +13 -11
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +1 -1
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +1 -1
- package/src/level/tiled/renderer/TMXRenderer.js +17 -17
- package/src/loader/loader.js +31 -27
- package/src/loader/loadingscreen.js +40 -72
- package/src/math/color.js +45 -64
- package/src/math/math.js +17 -17
- package/src/math/matrix2.js +46 -46
- package/src/math/matrix3.js +64 -64
- package/src/math/observable_vector2.js +45 -57
- package/src/math/observable_vector3.js +56 -70
- package/src/math/vector2.js +60 -59
- package/src/math/vector3.js +65 -64
- package/src/particles/emitter.js +53 -55
- package/src/particles/particle.js +1 -1
- package/src/physics/body.js +45 -51
- package/src/physics/bounds.js +36 -36
- package/src/physics/collision.js +15 -16
- package/src/physics/detector.js +10 -11
- package/src/physics/quadtree.js +19 -17
- package/src/physics/sat.js +17 -17
- package/src/physics/world.js +13 -10
- package/src/plugin/plugin.js +6 -6
- package/src/renderable/GUI.js +13 -18
- package/src/renderable/collectable.js +3 -3
- package/src/renderable/colorlayer.js +4 -4
- package/src/renderable/container.js +65 -46
- package/src/renderable/imagelayer.js +32 -31
- package/src/renderable/nineslicesprite.js +211 -0
- package/src/renderable/renderable.js +69 -67
- package/src/renderable/sprite.js +57 -43
- package/src/renderable/trigger.js +14 -15
- package/src/shapes/ellipse.js +27 -26
- package/src/shapes/line.js +8 -7
- package/src/shapes/poly.js +33 -31
- package/src/shapes/rectangle.js +50 -96
- package/src/state/stage.js +8 -8
- package/src/state/state.js +56 -56
- package/src/system/device.js +97 -84
- package/src/system/event.js +72 -72
- package/src/system/pooling.js +14 -14
- package/src/system/save.js +6 -3
- package/src/system/timer.js +20 -20
- package/src/text/bitmaptext.js +27 -33
- package/src/text/bitmaptextdata.js +9 -9
- package/src/text/text.js +118 -59
- package/src/tweens/easing.js +4 -4
- package/src/tweens/interpolation.js +4 -4
- package/src/tweens/tween.js +37 -27
- package/src/utils/agent.js +9 -8
- package/src/utils/array.js +4 -4
- package/src/utils/file.js +4 -4
- package/src/utils/function.js +5 -5
- package/src/utils/string.js +12 -12
- package/src/utils/utils.js +19 -19
- package/src/video/canvas/canvas_renderer.js +90 -90
- package/src/video/renderer.js +40 -39
- package/src/video/texture.js +85 -76
- package/src/video/texture_cache.js +11 -0
- package/src/video/video.js +30 -30
- package/src/video/webgl/buffer/vertex.js +9 -1
- package/src/video/webgl/glshader.js +20 -20
- package/src/video/webgl/webgl_compositor.js +47 -37
- 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
|
|
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 "melonjs
|
|
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
|
|
@@ -127,8 +127,6 @@ For your first time using melonJS, follow these tutorials :
|
|
|
127
127
|
- [Platformer](http://melonjs.github.io/tutorial-platformer/) Step by Step Tutorial.
|
|
128
128
|
- [Space Invaders](http://melonjs.github.io/tutorial-space-invaders/) Step by Step Tutorial.
|
|
129
129
|
|
|
130
|
-
> Note: current version of both the tutorials are not compatible with the ES6 version.
|
|
131
|
-
|
|
132
130
|
You may find it useful to skim the overview found at the wiki [Details & Usage](https://github.com/melonjs/melonJS/wiki#details--usage)
|
|
133
131
|
|
|
134
132
|
When starting your own projects, checkout our [es6 boilerplate](https://github.com/melonjs/es6-boilerplate)
|
|
@@ -172,15 +170,11 @@ If you need to import the ES6 module of melonjs (e.g. for Webpack):
|
|
|
172
170
|
Or can simply be added to your html, using [jsDeliver](https://www.jsdelivr.com/package/npm/melonjs) content delivery network (CDN) :
|
|
173
171
|
|
|
174
172
|
```html
|
|
175
|
-
<!-- load the
|
|
176
|
-
<script src="https://
|
|
177
|
-
<!-- load the ES6 module bundle of melonJS v10.0.0 -->
|
|
178
|
-
<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>
|
|
179
175
|
<!-- omit the version completely to get the latest one -->
|
|
180
176
|
<!-- you should NOT use this in production -->
|
|
181
|
-
<script src="https://
|
|
182
|
-
<!-- add ".min" to any JS/CSS file to get a minified version -->
|
|
183
|
-
<script src="https://cdn.jsdelivr.net/npm/melonjs@10.0.0/dist/melonjs.min.js"></script>
|
|
177
|
+
<script src="https://esm.run/melonjs"></script>
|
|
184
178
|
```
|
|
185
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)
|
|
186
180
|
|