melonjs 15.2.1 → 15.4.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/README.md +1 -1
- package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +1 -1
- package/dist/melonjs.mjs/_virtual/earcut.js +1 -1
- package/dist/melonjs.mjs/_virtual/howler.js +1 -1
- package/dist/melonjs.mjs/_virtual/index.js +1 -1
- package/dist/melonjs.mjs/application/application.js +75 -23
- package/dist/melonjs.mjs/application/header.js +2 -2
- package/dist/melonjs.mjs/application/resize.js +13 -11
- package/dist/melonjs.mjs/application/settings.js +37 -1
- package/dist/melonjs.mjs/audio/audio.js +4 -6
- package/dist/melonjs.mjs/camera/camera2d.js +12 -14
- package/dist/melonjs.mjs/const.js +1 -1
- package/dist/melonjs.mjs/entity/entity.js +3 -4
- package/dist/melonjs.mjs/geometries/ellipse.js +26 -59
- package/dist/melonjs.mjs/geometries/line.js +18 -25
- package/dist/melonjs.mjs/geometries/path2d.js +16 -13
- package/dist/melonjs.mjs/geometries/point.js +8 -16
- package/dist/melonjs.mjs/geometries/poly.js +40 -97
- package/dist/melonjs.mjs/geometries/rectangle.js +37 -91
- package/dist/melonjs.mjs/geometries/roundrect.js +26 -35
- package/dist/melonjs.mjs/index.js +6 -6
- package/dist/melonjs.mjs/input/gamepad.js +1 -1
- package/dist/melonjs.mjs/input/input.js +1 -1
- package/dist/melonjs.mjs/input/keyboard.js +3 -3
- package/dist/melonjs.mjs/input/pointer.js +4 -4
- package/dist/melonjs.mjs/input/pointerevent.js +6 -7
- package/dist/melonjs.mjs/lang/console.js +1 -1
- package/dist/melonjs.mjs/lang/deprecated.js +2 -2
- package/dist/melonjs.mjs/level/level.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXGroup.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXLayer.js +16 -33
- package/dist/melonjs.mjs/level/tiled/TMXObject.js +3 -4
- package/dist/melonjs.mjs/level/tiled/TMXTile.js +4 -4
- package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +3 -3
- package/dist/melonjs.mjs/level/tiled/TMXTileset.js +4 -7
- package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +2 -2
- package/dist/melonjs.mjs/level/tiled/TMXUtils.js +37 -47
- package/dist/melonjs.mjs/level/tiled/constants.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +3 -3
- package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +2 -2
- package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +2 -2
- package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +2 -2
- package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +2 -2
- package/dist/melonjs.mjs/level/tiled/renderer/autodetect.js +1 -1
- package/dist/melonjs.mjs/loader/cache.js +1 -1
- package/dist/melonjs.mjs/loader/loader.js +1 -1
- package/dist/melonjs.mjs/loader/loadingscreen.js +1 -1
- package/dist/melonjs.mjs/loader/melonjs_logo.png.js +1 -1
- package/dist/melonjs.mjs/loader/parser.js +4 -5
- package/dist/melonjs.mjs/loader/settings.js +1 -1
- package/dist/melonjs.mjs/math/color.js +5 -5
- package/dist/melonjs.mjs/math/math.js +1 -1
- package/dist/melonjs.mjs/math/matrix2.js +5 -59
- package/dist/melonjs.mjs/math/matrix3.js +82 -141
- package/dist/melonjs.mjs/math/observable_vector2.js +7 -7
- package/dist/melonjs.mjs/math/observable_vector3.js +5 -5
- package/dist/melonjs.mjs/math/vector2.js +7 -91
- package/dist/melonjs.mjs/math/vector3.js +6 -90
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.js +1 -1
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/multimap.js +1 -1
- package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +1 -1
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +1 -1
- package/dist/melonjs.mjs/node_modules/eventemitter3/index2.js +1 -1
- package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +1 -1
- package/dist/melonjs.mjs/particles/emitter.js +2 -2
- package/dist/melonjs.mjs/particles/particle.js +2 -2
- package/dist/melonjs.mjs/particles/settings.js +1 -1
- package/dist/melonjs.mjs/physics/body.js +22 -20
- package/dist/melonjs.mjs/physics/bounds.js +27 -33
- package/dist/melonjs.mjs/physics/collision.js +5 -5
- package/dist/melonjs.mjs/physics/detector.js +10 -10
- package/dist/melonjs.mjs/physics/quadtree.js +5 -5
- package/dist/melonjs.mjs/physics/response.js +1 -1
- package/dist/melonjs.mjs/physics/sat.js +3 -4
- package/dist/melonjs.mjs/physics/world.js +6 -9
- package/dist/melonjs.mjs/plugin/plugin.js +3 -3
- package/dist/melonjs.mjs/renderable/collectable.js +2 -2
- package/dist/melonjs.mjs/renderable/colorlayer.js +4 -4
- package/dist/melonjs.mjs/renderable/container.js +25 -25
- package/dist/melonjs.mjs/renderable/draggable.js +1 -1
- package/dist/melonjs.mjs/renderable/dragndrop.js +1 -1
- package/dist/melonjs.mjs/renderable/imagelayer.js +4 -4
- package/dist/melonjs.mjs/renderable/light2d.js +3 -3
- package/dist/melonjs.mjs/renderable/nineslicesprite.js +2 -2
- package/dist/melonjs.mjs/renderable/renderable.js +31 -39
- package/dist/melonjs.mjs/renderable/sprite.js +3 -3
- package/dist/melonjs.mjs/renderable/text/bitmaptext.js +421 -0
- package/dist/melonjs.mjs/renderable/text/bitmaptextdata.js +195 -0
- package/dist/melonjs.mjs/renderable/text/glyph.js +65 -0
- package/dist/melonjs.mjs/renderable/text/text.js +422 -0
- package/dist/melonjs.mjs/renderable/text/textmetrics.js +175 -0
- package/dist/melonjs.mjs/renderable/text/textstyle.js +21 -0
- package/dist/melonjs.mjs/renderable/trigger.js +10 -10
- package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +7 -7
- package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +7 -7
- package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +3 -3
- package/dist/melonjs.mjs/state/stage.js +13 -14
- package/dist/melonjs.mjs/state/state.js +4 -51
- package/dist/melonjs.mjs/system/device.js +51 -10
- package/dist/melonjs.mjs/system/dom.js +1 -1
- package/dist/melonjs.mjs/system/event.js +46 -2
- package/dist/melonjs.mjs/system/platform.js +18 -18
- package/dist/melonjs.mjs/system/pooling.js +10 -10
- package/dist/melonjs.mjs/system/save.js +1 -1
- package/dist/melonjs.mjs/system/timer.js +1 -1
- package/dist/melonjs.mjs/text/bitmaptext.js +1 -1
- package/dist/melonjs.mjs/text/bitmaptextdata.js +3 -6
- package/dist/melonjs.mjs/text/glyph.js +1 -1
- package/dist/melonjs.mjs/text/text.js +1 -1
- package/dist/melonjs.mjs/text/textmetrics.js +1 -1
- package/dist/melonjs.mjs/text/textstyle.js +1 -1
- package/dist/melonjs.mjs/tweens/easing.js +1 -1
- package/dist/melonjs.mjs/tweens/interpolation.js +1 -1
- package/dist/melonjs.mjs/tweens/tween.js +2 -2
- package/dist/melonjs.mjs/utils/agent.js +1 -1
- package/dist/melonjs.mjs/utils/array.js +1 -1
- package/dist/melonjs.mjs/utils/file.js +1 -1
- package/dist/melonjs.mjs/utils/function.js +2 -3
- package/dist/melonjs.mjs/utils/string.js +1 -1
- package/dist/melonjs.mjs/utils/utils.js +1 -1
- package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +5 -18
- package/dist/melonjs.mjs/video/renderer.js +17 -30
- package/dist/melonjs.mjs/video/texture/atlas.js +13 -13
- package/dist/melonjs.mjs/video/texture/cache.js +1 -1
- package/dist/melonjs.mjs/video/texture/canvas_texture.js +15 -15
- package/dist/melonjs.mjs/video/utils/autodetect.js +1 -1
- package/dist/melonjs.mjs/video/video.js +5 -29
- package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +3 -3
- package/dist/melonjs.mjs/video/webgl/compositors/compositor.js +13 -14
- package/dist/melonjs.mjs/video/webgl/compositors/primitive_compositor.js +5 -5
- package/dist/melonjs.mjs/video/webgl/compositors/quad_compositor.js +2 -3
- package/dist/melonjs.mjs/video/webgl/glshader.js +2 -2
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/attributes.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/precision.js +4 -4
- package/dist/melonjs.mjs/video/webgl/utils/program.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/string.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +1 -1
- package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +62 -67
- package/dist/melonjs.module.js +1272 -1713
- package/dist/types/application/application.d.ts +32 -31
- package/dist/types/application/header.d.ts +2 -2
- package/dist/types/application/settings.d.ts +80 -16
- package/dist/types/audio/audio.d.ts +4 -6
- package/dist/types/camera/camera2d.d.ts +13 -16
- package/dist/types/entity/entity.d.ts +0 -1
- package/dist/types/geometries/ellipse.d.ts +18 -50
- package/dist/types/geometries/path2d.d.ts +1 -1
- package/dist/types/geometries/point.d.ts +5 -13
- package/dist/types/geometries/poly.d.ts +26 -75
- package/dist/types/geometries/rectangle.d.ts +12 -58
- package/dist/types/geometries/roundrect.d.ts +2 -11
- package/dist/types/index.d.ts +3 -3
- package/dist/types/input/gamepad.d.ts +31 -31
- package/dist/types/input/keyboard.d.ts +105 -105
- package/dist/types/input/pointer.d.ts +21 -21
- package/dist/types/input/pointerevent.d.ts +6 -6
- package/dist/types/level/tiled/TMXLayer.d.ts +1 -1
- package/dist/types/level/tiled/TMXUtils.d.ts +4 -6
- package/dist/types/math/matrix2.d.ts +9 -63
- package/dist/types/math/matrix3.d.ts +9 -68
- package/dist/types/math/observable_vector2.d.ts +2 -2
- package/dist/types/math/observable_vector3.d.ts +2 -2
- package/dist/types/math/vector2.d.ts +8 -92
- package/dist/types/math/vector3.d.ts +8 -92
- package/dist/types/particles/settings.d.ts +29 -29
- package/dist/types/physics/body.d.ts +10 -8
- package/dist/types/physics/bounds.d.ts +24 -30
- package/dist/types/physics/collision.d.ts +12 -12
- package/dist/types/physics/detector.d.ts +1 -1
- package/dist/types/physics/world.d.ts +4 -7
- package/dist/types/renderable/container.d.ts +19 -19
- package/dist/types/renderable/imagelayer.d.ts +6 -6
- package/dist/types/renderable/light2d.d.ts +7 -7
- package/dist/types/renderable/renderable.d.ts +10 -18
- package/dist/types/renderable/text/bitmaptext.d.ts +151 -0
- package/dist/types/renderable/text/bitmaptextdata.d.ts +35 -0
- package/dist/types/renderable/text/glyph.d.ts +28 -0
- package/dist/types/renderable/text/text.d.ts +159 -0
- package/dist/types/renderable/text/textmetrics.d.ts +47 -0
- package/dist/types/renderable/text/textstyle.d.ts +5 -0
- package/dist/types/renderable/ui/uibaseelement.d.ts +0 -1
- package/dist/types/renderable/ui/uispriteelement.d.ts +0 -1
- package/dist/types/renderable/ui/uitextbutton.d.ts +2 -7
- package/dist/types/state/stage.d.ts +3 -2
- package/dist/types/state/state.d.ts +11 -11
- package/dist/types/system/device.d.ts +16 -9
- package/dist/types/system/event.d.ts +40 -0
- package/dist/types/system/platform.d.ts +17 -17
- package/dist/types/utils/function.d.ts +1 -2
- package/dist/types/video/canvas/canvas_renderer.d.ts +0 -23
- package/dist/types/video/renderer.d.ts +16 -43
- package/dist/types/video/texture/canvas_texture.d.ts +14 -14
- package/dist/types/video/video.d.ts +4 -38
- package/dist/types/video/webgl/buffer/vertex.d.ts +2 -2
- package/dist/types/video/webgl/compositors/compositor.d.ts +24 -13
- package/dist/types/video/webgl/compositors/primitive_compositor.d.ts +0 -1
- package/dist/types/video/webgl/compositors/quad_compositor.d.ts +0 -1
- package/dist/types/video/webgl/utils/precision.d.ts +1 -1
- package/dist/types/video/webgl/webgl_renderer.d.ts +48 -84
- package/package.json +15 -15
- package/src/application/application.js +73 -21
- package/src/application/header.js +1 -1
- package/src/application/resize.js +11 -9
- package/src/application/settings.js +36 -0
- package/src/audio/audio.js +3 -5
- package/src/camera/camera2d.js +11 -13
- package/src/entity/entity.js +2 -3
- package/src/geometries/ellipse.js +25 -58
- package/src/geometries/line.js +17 -24
- package/src/geometries/path2d.js +15 -12
- package/src/geometries/point.js +7 -15
- package/src/geometries/poly.js +39 -96
- package/src/geometries/rectangle.js +36 -90
- package/src/geometries/roundrect.js +25 -34
- package/src/index.js +4 -4
- package/src/input/keyboard.js +2 -2
- package/src/input/pointer.js +3 -3
- package/src/input/pointerevent.js +5 -6
- package/src/lang/deprecated.js +1 -1
- package/src/level/tiled/TMXLayer.js +15 -32
- package/src/level/tiled/TMXObject.js +2 -3
- package/src/level/tiled/TMXTile.js +3 -3
- package/src/level/tiled/TMXTileMap.js +2 -2
- package/src/level/tiled/TMXTileset.js +3 -6
- package/src/level/tiled/TMXTilesetGroup.js +1 -1
- package/src/level/tiled/TMXUtils.js +36 -46
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +2 -2
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +1 -1
- package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +1 -1
- package/src/level/tiled/renderer/TMXRenderer.js +1 -1
- package/src/level/tiled/renderer/TMXStaggeredRenderer.js +1 -1
- package/src/loader/parser.js +3 -4
- package/src/math/color.js +4 -4
- package/src/math/matrix2.js +4 -58
- package/src/math/matrix3.js +81 -140
- package/src/math/observable_vector2.js +6 -6
- package/src/math/observable_vector3.js +4 -4
- package/src/math/vector2.js +6 -90
- package/src/math/vector3.js +5 -89
- package/src/particles/emitter.js +1 -1
- package/src/particles/particle.js +1 -1
- package/src/physics/body.js +21 -19
- package/src/physics/bounds.js +26 -32
- package/src/physics/collision.js +4 -4
- package/src/physics/detector.js +9 -9
- package/src/physics/quadtree.js +4 -4
- package/src/physics/sat.js +2 -3
- package/src/physics/world.js +5 -8
- package/src/polyfill/roundrect.js +163 -163
- package/src/renderable/collectable.js +1 -1
- package/src/renderable/colorlayer.js +3 -3
- package/src/renderable/container.js +24 -24
- package/src/renderable/imagelayer.js +3 -3
- package/src/renderable/light2d.js +2 -2
- package/src/renderable/nineslicesprite.js +1 -1
- package/src/renderable/renderable.js +30 -38
- package/src/renderable/sprite.js +2 -2
- package/src/{text → renderable/text}/bitmaptext.js +8 -8
- package/src/{text → renderable/text}/bitmaptextdata.js +4 -7
- package/src/{text → renderable/text}/glyph.js +1 -1
- package/src/{text → renderable/text}/text.js +16 -17
- package/src/{text → renderable/text}/textmetrics.js +2 -2
- package/src/renderable/trigger.js +9 -9
- package/src/renderable/ui/uibaseelement.js +6 -6
- package/src/renderable/ui/uispriteelement.js +6 -6
- package/src/renderable/ui/uitextbutton.js +2 -2
- package/src/state/stage.js +12 -13
- package/src/state/state.js +2 -61
- package/src/system/device.js +50 -9
- package/src/system/event.js +44 -0
- package/src/system/platform.js +18 -18
- package/src/system/pooling.js +9 -9
- package/src/tweens/tween.js +1 -1
- package/src/utils/function.js +1 -2
- package/src/video/canvas/canvas_renderer.js +4 -17
- package/src/video/renderer.js +16 -29
- package/src/video/texture/atlas.js +12 -12
- package/src/video/texture/canvas_texture.js +14 -14
- package/src/video/video.js +7 -28
- package/src/video/webgl/buffer/vertex.js +2 -2
- package/src/video/webgl/compositors/compositor.js +12 -13
- package/src/video/webgl/compositors/primitive_compositor.js +4 -4
- package/src/video/webgl/compositors/quad_compositor.js +1 -2
- package/src/video/webgl/glshader.js +1 -1
- package/src/video/webgl/utils/precision.js +3 -3
- package/src/video/webgl/webgl_renderer.js +61 -66
- /package/src/{text → renderable/text}/textstyle.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -7,12 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { isBoolean, isNumeric } from '../../utils/string.js';
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* a collection of utility functions for parsing TMX maps
|
|
12
|
-
* @namespace TMXUtils
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
10
|
/**
|
|
17
11
|
* the function used to decompress zlib/gzip data
|
|
18
12
|
* @ignore
|
|
@@ -122,8 +116,8 @@ function normalize(obj, item) {
|
|
|
122
116
|
let nodeName = item.nodeName;
|
|
123
117
|
|
|
124
118
|
switch (nodeName) {
|
|
125
|
-
case "data":
|
|
126
|
-
|
|
119
|
+
case "data": {
|
|
120
|
+
let data = parse(item);
|
|
127
121
|
|
|
128
122
|
data.encoding = data.encoding || "xml";
|
|
129
123
|
|
|
@@ -151,7 +145,7 @@ function normalize(obj, item) {
|
|
|
151
145
|
obj.encoding = "none";
|
|
152
146
|
}
|
|
153
147
|
break;
|
|
154
|
-
|
|
148
|
+
}
|
|
155
149
|
case "chunk":
|
|
156
150
|
obj.chunks = obj.chunks || [];
|
|
157
151
|
obj.chunks.push(parse(item));
|
|
@@ -160,8 +154,8 @@ function normalize(obj, item) {
|
|
|
160
154
|
case "imagelayer":
|
|
161
155
|
case "layer":
|
|
162
156
|
case "objectgroup":
|
|
163
|
-
case "group":
|
|
164
|
-
|
|
157
|
+
case "group": {
|
|
158
|
+
let layer = parse(item);
|
|
165
159
|
layer.type = (nodeName === "layer" ? "tilelayer" : nodeName);
|
|
166
160
|
if (layer.image) {
|
|
167
161
|
layer.image = layer.image.source;
|
|
@@ -170,20 +164,20 @@ function normalize(obj, item) {
|
|
|
170
164
|
obj.layers = obj.layers || [];
|
|
171
165
|
obj.layers.push(layer);
|
|
172
166
|
break;
|
|
173
|
-
|
|
167
|
+
}
|
|
174
168
|
case "animation":
|
|
175
169
|
obj.animation = parse(item).frames;
|
|
176
170
|
break;
|
|
177
171
|
|
|
178
172
|
case "frame":
|
|
179
|
-
case "object":
|
|
180
|
-
|
|
173
|
+
case "object": {
|
|
174
|
+
const name = nodeName + "s";
|
|
181
175
|
obj[name] = obj[name] || [];
|
|
182
176
|
obj[name].push(parse(item));
|
|
183
177
|
break;
|
|
184
|
-
|
|
185
|
-
case "tile":
|
|
186
|
-
|
|
178
|
+
}
|
|
179
|
+
case "tile": {
|
|
180
|
+
let tile = parse(item);
|
|
187
181
|
if (tile.image) {
|
|
188
182
|
tile.imagewidth = tile.image.width;
|
|
189
183
|
tile.imageheight = tile.image.height;
|
|
@@ -192,9 +186,9 @@ function normalize(obj, item) {
|
|
|
192
186
|
obj.tiles = obj.tiles || {};
|
|
193
187
|
obj.tiles[tile.id] = tile;
|
|
194
188
|
break;
|
|
195
|
-
|
|
196
|
-
case "tileset":
|
|
197
|
-
|
|
189
|
+
}
|
|
190
|
+
case "tileset": {
|
|
191
|
+
let tileset = parse(item);
|
|
198
192
|
if (tileset.image) {
|
|
199
193
|
tileset.imagewidth = tileset.image.width;
|
|
200
194
|
tileset.imageheight = tileset.image.height;
|
|
@@ -204,13 +198,13 @@ function normalize(obj, item) {
|
|
|
204
198
|
obj.tilesets = obj.tilesets || [];
|
|
205
199
|
obj.tilesets.push(tileset);
|
|
206
200
|
break;
|
|
207
|
-
|
|
201
|
+
}
|
|
208
202
|
case "polygon":
|
|
209
|
-
case "polyline":
|
|
203
|
+
case "polyline": {
|
|
210
204
|
obj[nodeName] = [];
|
|
211
205
|
|
|
212
206
|
// Get a point array
|
|
213
|
-
|
|
207
|
+
let points = parse(item).points.split(" ");
|
|
214
208
|
|
|
215
209
|
// And normalize them into an array of vectors
|
|
216
210
|
for (let i = 0; i < points.length; i++) {
|
|
@@ -222,15 +216,15 @@ function normalize(obj, item) {
|
|
|
222
216
|
}
|
|
223
217
|
|
|
224
218
|
break;
|
|
225
|
-
|
|
219
|
+
}
|
|
226
220
|
case "properties":
|
|
227
221
|
obj.properties = parse(item);
|
|
228
222
|
break;
|
|
229
223
|
|
|
230
|
-
case "property":
|
|
231
|
-
|
|
224
|
+
case "property": {
|
|
225
|
+
const property = parse(item);
|
|
232
226
|
// for custom properties, text is used
|
|
233
|
-
|
|
227
|
+
const value = (typeof property.value !== "undefined") ? property.value : property.text;
|
|
234
228
|
|
|
235
229
|
obj[property.name] = setTMXValue(
|
|
236
230
|
property.name,
|
|
@@ -239,18 +233,21 @@ function normalize(obj, item) {
|
|
|
239
233
|
value
|
|
240
234
|
);
|
|
241
235
|
break;
|
|
242
|
-
|
|
236
|
+
}
|
|
243
237
|
default:
|
|
244
238
|
obj[nodeName] = parse(item);
|
|
245
239
|
break;
|
|
246
240
|
}
|
|
247
241
|
}
|
|
248
242
|
|
|
243
|
+
/**
|
|
244
|
+
* a collection of utility functions for parsing TMX maps
|
|
245
|
+
* @namespace TMXUtils
|
|
246
|
+
*/
|
|
249
247
|
|
|
250
248
|
/**
|
|
251
249
|
* decompress and decode zlib/gzip data
|
|
252
|
-
* @
|
|
253
|
-
* @memberOf TMXUtils
|
|
250
|
+
* @memberof TMXUtils
|
|
254
251
|
* @param {string} input - Base64 encoded and compressed data
|
|
255
252
|
* @param {string} format - compressed data format ("gzip","zlib", "zstd")
|
|
256
253
|
* @returns {Uint32Array} Decoded and decompress data
|
|
@@ -265,8 +262,7 @@ function decompress(data, format) {
|
|
|
265
262
|
|
|
266
263
|
/**
|
|
267
264
|
* Decode a CSV encoded array into a binary array
|
|
268
|
-
* @
|
|
269
|
-
* @memberOf TMXUtils
|
|
265
|
+
* @memberof TMXUtils
|
|
270
266
|
* @param {string} input- - CSV formatted data (only numbers, everything else will be converted to NaN)
|
|
271
267
|
* @returns {number[]} Decoded data
|
|
272
268
|
*/
|
|
@@ -282,22 +278,18 @@ function decodeCSV(input) {
|
|
|
282
278
|
|
|
283
279
|
/**
|
|
284
280
|
* Decode a base64 encoded string into a byte array
|
|
285
|
-
* @
|
|
286
|
-
* @memberOf TMXUtils
|
|
281
|
+
* @memberof TMXUtils
|
|
287
282
|
* @param {string} input - Base64 encoded data
|
|
288
283
|
* @param {number} [bytes] - number of bytes per array entry
|
|
289
284
|
* @returns {Uint32Array} Decoded data
|
|
290
285
|
*/
|
|
291
|
-
function decodeBase64AsArray(input, bytes) {
|
|
292
|
-
bytes = bytes || 1;
|
|
293
|
-
|
|
294
|
-
let i, j, len;
|
|
286
|
+
function decodeBase64AsArray(input, bytes = 1) {
|
|
295
287
|
let dec = globalThis.atob(input.replace(/[^A-Za-z0-9\+\/\=]/g, ""));
|
|
296
288
|
let ar = new Uint32Array(dec.length / bytes);
|
|
297
289
|
|
|
298
|
-
for (i = 0, len = dec.length / bytes; i < len; i++) {
|
|
290
|
+
for (let i = 0, len = dec.length / bytes; i < len; i++) {
|
|
299
291
|
ar[i] = 0;
|
|
300
|
-
for (j = bytes - 1; j >= 0; --j) {
|
|
292
|
+
for (let j = bytes - 1; j >= 0; --j) {
|
|
301
293
|
ar[i] += dec.charCodeAt((i * bytes) + j) << (j << 3);
|
|
302
294
|
}
|
|
303
295
|
}
|
|
@@ -306,6 +298,7 @@ function decodeBase64AsArray(input, bytes) {
|
|
|
306
298
|
|
|
307
299
|
/**
|
|
308
300
|
* set the function used to inflate gzip/zlib data
|
|
301
|
+
* @memberof TMXUtils
|
|
309
302
|
* @param {Func} fn - inflate function
|
|
310
303
|
*/
|
|
311
304
|
function setInflateFunction(fn) {
|
|
@@ -314,8 +307,7 @@ function setInflateFunction(fn) {
|
|
|
314
307
|
|
|
315
308
|
/**
|
|
316
309
|
* Decode a encoded array into a binary array
|
|
317
|
-
* @
|
|
318
|
-
* @memberOf TMXUtils
|
|
310
|
+
* @memberof TMXUtils
|
|
319
311
|
* @param {string} data - data to be decoded
|
|
320
312
|
* @param {string} [encoding="none"] - data encoding ("csv", "base64", "xml")
|
|
321
313
|
* @returns {number[]} Decoded data
|
|
@@ -349,8 +341,7 @@ function decode(data, encoding, compression) {
|
|
|
349
341
|
|
|
350
342
|
/**
|
|
351
343
|
* Parse a XML TMX object and returns the corresponding javascript object
|
|
352
|
-
* @
|
|
353
|
-
* @memberOf TMXUtils
|
|
344
|
+
* @memberof TMXUtils
|
|
354
345
|
* @param {Document} xml - XML TMX object
|
|
355
346
|
* @returns {object} Javascript object
|
|
356
347
|
*/
|
|
@@ -390,8 +381,7 @@ function parse(xml) {
|
|
|
390
381
|
|
|
391
382
|
/**
|
|
392
383
|
* Apply TMX Properties to the given object
|
|
393
|
-
* @
|
|
394
|
-
* @memberOf TMXUtils
|
|
384
|
+
* @memberof TMXUtils
|
|
395
385
|
* @param {object} obj - object to apply the properties to
|
|
396
386
|
* @param {object} data - TMX data object
|
|
397
387
|
* @returns {object} obj
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -29,7 +29,7 @@ const offsetsStaggerY = [
|
|
|
29
29
|
* an Hexagonal Map Renderder
|
|
30
30
|
* @augments TMXRenderer
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
class TMXHexagonalRenderer extends TMXRenderer {
|
|
33
33
|
/**
|
|
34
34
|
* @param {TMXTileMap} map - the TMX map
|
|
35
35
|
*/
|
|
@@ -395,7 +395,7 @@ const offsetsStaggerY = [
|
|
|
395
395
|
let rowTile = startTile.clone();
|
|
396
396
|
let rowPos = startPos.clone();
|
|
397
397
|
|
|
398
|
-
|
|
398
|
+
/* Determine in which half of the tile the top-left corner of the area we
|
|
399
399
|
* need to draw is. If we're in the upper half, we need to start one row
|
|
400
400
|
* up due to those tiles being visible as well. How we go up one row
|
|
401
401
|
* depends on whether we're in the left or right half of the tile.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -15,7 +15,7 @@ import TMXLayer from '../TMXLayer.js';
|
|
|
15
15
|
* an Isometric Map Renderder
|
|
16
16
|
* @augments TMXRenderer
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
class TMXIsometricRenderer extends TMXRenderer {
|
|
19
19
|
/**
|
|
20
20
|
* @param {TMXTileMap} map - the TMX map
|
|
21
21
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -14,7 +14,7 @@ import TMXRenderer from './TMXRenderer.js';
|
|
|
14
14
|
* an Orthogonal Map Renderder
|
|
15
15
|
* @augments TMXRenderer
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
class TMXOrthogonalRenderer extends TMXRenderer {
|
|
18
18
|
/**
|
|
19
19
|
* @param {TMXTileMap} map - the TMX map
|
|
20
20
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -16,7 +16,7 @@ import Bounds from '../../../physics/bounds.js';
|
|
|
16
16
|
* @classdesc
|
|
17
17
|
* The map renderer base class
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
class TMXRenderer {
|
|
20
20
|
/**
|
|
21
21
|
* @param {number} cols - width of the tilemap in tiles
|
|
22
22
|
* @param {number} rows - height of the tilemap in tiles
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -15,7 +15,7 @@ import { degToRad } from '../../../math/math.js';
|
|
|
15
15
|
* a Staggered Map Renderder
|
|
16
16
|
* @augments TMXHexagonalRenderer
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
class TMXStaggeredRenderer extends TMXHexagonalRenderer {
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* return true if the renderer can render the specified layer
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -128,7 +128,7 @@ function preloadTMX(tmxData, onload, onerror) {
|
|
|
128
128
|
switch (format) {
|
|
129
129
|
case "xml":
|
|
130
130
|
case "tmx":
|
|
131
|
-
case "tsx":
|
|
131
|
+
case "tsx": {
|
|
132
132
|
// ie9 does not fully implement the responseXML
|
|
133
133
|
if (ua.match(/msie/i) || !xmlhttp.responseXML) {
|
|
134
134
|
if (globalThis.DOMParser) {
|
|
@@ -142,7 +142,7 @@ function preloadTMX(tmxData, onload, onerror) {
|
|
|
142
142
|
result = xmlhttp.responseXML;
|
|
143
143
|
}
|
|
144
144
|
// converts to a JS object
|
|
145
|
-
|
|
145
|
+
const data = parse(result);
|
|
146
146
|
switch (format) {
|
|
147
147
|
case "tmx":
|
|
148
148
|
result = data.map;
|
|
@@ -152,9 +152,8 @@ function preloadTMX(tmxData, onload, onerror) {
|
|
|
152
152
|
result = data.tilesets[0];
|
|
153
153
|
break;
|
|
154
154
|
}
|
|
155
|
-
|
|
156
155
|
break;
|
|
157
|
-
|
|
156
|
+
}
|
|
158
157
|
case "json":
|
|
159
158
|
case "tmj":
|
|
160
159
|
case "tsj":
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -189,7 +189,7 @@ let cssToRGB = new Map();
|
|
|
189
189
|
* @classdesc
|
|
190
190
|
* A color manipulation object.
|
|
191
191
|
*/
|
|
192
|
-
|
|
192
|
+
class Color {
|
|
193
193
|
/**
|
|
194
194
|
* @param {number} [r=0] - red component or array of color components
|
|
195
195
|
* @param {number} [g=0] - green component
|
|
@@ -343,12 +343,12 @@ let cssToRGB = new Map();
|
|
|
343
343
|
* @returns {Color} Reference to this object for method chaining
|
|
344
344
|
*/
|
|
345
345
|
copy(color) {
|
|
346
|
-
if (color
|
|
346
|
+
if (typeof color === "string") {
|
|
347
|
+
return this.parseCSS(color);
|
|
348
|
+
} else {
|
|
347
349
|
this.glArray.set(color.glArray);
|
|
348
350
|
return this;
|
|
349
351
|
}
|
|
350
|
-
|
|
351
|
-
return this.parseCSS(color);
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.
|
|
2
|
+
* melonJS Game Engine - v15.4.0
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -14,7 +14,7 @@ import Matrix3d from './matrix3.js';
|
|
|
14
14
|
* the identity matrix and parameters position : <br>
|
|
15
15
|
* <img src="images/identity-matrix_2x.png"/>
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
class Matrix2d {
|
|
18
18
|
/**
|
|
19
19
|
* @param {(Matrix2d|Matrix3d|...number)} args - an instance of me.Matrix2d or me.Matrix3d to copy from, or individual matrix components (See {@link Matrix2d.setTransform}). If not arguments are given, the matrix will be set to Identity.
|
|
20
20
|
*/
|
|
@@ -47,11 +47,8 @@ import Matrix3d from './matrix3.js';
|
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* tx component of the matrix
|
|
50
|
-
* @public
|
|
51
50
|
* @type {number}
|
|
52
51
|
* @see Matrix2d.translate
|
|
53
|
-
* @name tx
|
|
54
|
-
* @memberof Matrix2d
|
|
55
52
|
*/
|
|
56
53
|
get tx() {
|
|
57
54
|
return this.val[6];
|
|
@@ -59,11 +56,8 @@ import Matrix3d from './matrix3.js';
|
|
|
59
56
|
|
|
60
57
|
/**
|
|
61
58
|
* ty component of the matrix
|
|
62
|
-
* @public
|
|
63
59
|
* @type {number}
|
|
64
60
|
* @see Matrix2d.translate
|
|
65
|
-
* @name ty
|
|
66
|
-
* @memberof Matrix2d
|
|
67
61
|
*/
|
|
68
62
|
get ty() {
|
|
69
63
|
return this.val[7];
|
|
@@ -73,8 +67,6 @@ import Matrix3d from './matrix3.js';
|
|
|
73
67
|
* reset the transformation matrix to the identity matrix (no transformation).<br>
|
|
74
68
|
* the identity matrix and parameters position : <br>
|
|
75
69
|
* <img src="images/identity-matrix_2x.png"/>
|
|
76
|
-
* @name identity
|
|
77
|
-
* @memberof Matrix2d
|
|
78
70
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
79
71
|
*/
|
|
80
72
|
identity() {
|
|
@@ -88,8 +80,6 @@ import Matrix3d from './matrix3.js';
|
|
|
88
80
|
|
|
89
81
|
/**
|
|
90
82
|
* set the matrix to the specified value
|
|
91
|
-
* @name setTransform
|
|
92
|
-
* @memberof Matrix2d
|
|
93
83
|
* @param {number} a
|
|
94
84
|
* @param {number} b
|
|
95
85
|
* @param {number} c
|
|
@@ -131,8 +121,6 @@ import Matrix3d from './matrix3.js';
|
|
|
131
121
|
|
|
132
122
|
/**
|
|
133
123
|
* Copies over the values from another me.Matrix2d.
|
|
134
|
-
* @name copy
|
|
135
|
-
* @memberof Matrix2d
|
|
136
124
|
* @param {Matrix2d} m - the matrix object to copy from
|
|
137
125
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
138
126
|
*/
|
|
@@ -143,8 +131,6 @@ import Matrix3d from './matrix3.js';
|
|
|
143
131
|
|
|
144
132
|
/**
|
|
145
133
|
* Copies over the upper-left 3x3 values from the given me.Matrix3d
|
|
146
|
-
* @name fromMat3d
|
|
147
|
-
* @memberof Matrix2d
|
|
148
134
|
* @param {Matrix3d} m - the matrix object to copy from
|
|
149
135
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
150
136
|
*/
|
|
@@ -167,8 +153,6 @@ import Matrix3d from './matrix3.js';
|
|
|
167
153
|
|
|
168
154
|
/**
|
|
169
155
|
* multiply both matrix
|
|
170
|
-
* @name multiply
|
|
171
|
-
* @memberof Matrix2d
|
|
172
156
|
* @param {Matrix2d} m - the other matrix
|
|
173
157
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
174
158
|
*/
|
|
@@ -198,8 +182,6 @@ import Matrix3d from './matrix3.js';
|
|
|
198
182
|
|
|
199
183
|
/**
|
|
200
184
|
* Transpose the value of this matrix.
|
|
201
|
-
* @name transpose
|
|
202
|
-
* @memberof Matrix2d
|
|
203
185
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
204
186
|
*/
|
|
205
187
|
transpose() {
|
|
@@ -220,8 +202,6 @@ import Matrix3d from './matrix3.js';
|
|
|
220
202
|
|
|
221
203
|
/**
|
|
222
204
|
* invert this matrix, causing it to apply the opposite transformation.
|
|
223
|
-
* @name invert
|
|
224
|
-
* @memberof Matrix2d
|
|
225
205
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
226
206
|
*/
|
|
227
207
|
invert() {
|
|
@@ -252,10 +232,8 @@ import Matrix3d from './matrix3.js';
|
|
|
252
232
|
return this;
|
|
253
233
|
}
|
|
254
234
|
|
|
255
|
-
|
|
235
|
+
/**
|
|
256
236
|
* apply the current transform to the given 2d or 3d vector
|
|
257
|
-
* @name apply
|
|
258
|
-
* @memberof Matrix2d
|
|
259
237
|
* @param {Vector2d|Vector3d} v - the vector object to be transformed
|
|
260
238
|
* @returns {Vector2d|Vector3d} result vector object.
|
|
261
239
|
*/
|
|
@@ -277,8 +255,6 @@ import Matrix3d from './matrix3.js';
|
|
|
277
255
|
|
|
278
256
|
/**
|
|
279
257
|
* apply the inverted current transform to the given 2d vector
|
|
280
|
-
* @name applyInverse
|
|
281
|
-
* @memberof Matrix2d
|
|
282
258
|
* @param {Vector2d} v - the vector object to be transformed
|
|
283
259
|
* @returns {Vector2d} result vector object.
|
|
284
260
|
*/
|
|
@@ -297,8 +273,6 @@ import Matrix3d from './matrix3.js';
|
|
|
297
273
|
|
|
298
274
|
/**
|
|
299
275
|
* scale the matrix
|
|
300
|
-
* @name scale
|
|
301
|
-
* @memberof Matrix2d
|
|
302
276
|
* @param {number} x - a number representing the abscissa of the scaling vector.
|
|
303
277
|
* @param {number} [y=x] - a number representing the ordinate of the scaling vector.
|
|
304
278
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
@@ -316,8 +290,6 @@ import Matrix3d from './matrix3.js';
|
|
|
316
290
|
|
|
317
291
|
/**
|
|
318
292
|
* adds a 2D scaling transformation.
|
|
319
|
-
* @name scaleV
|
|
320
|
-
* @memberof Matrix2d
|
|
321
293
|
* @param {Vector2d} v - scaling vector
|
|
322
294
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
323
295
|
*/
|
|
@@ -327,8 +299,6 @@ import Matrix3d from './matrix3.js';
|
|
|
327
299
|
|
|
328
300
|
/**
|
|
329
301
|
* specifies a 2D scale operation using the [sx, 1] scaling vector
|
|
330
|
-
* @name scaleX
|
|
331
|
-
* @memberof Matrix2d
|
|
332
302
|
* @param {number} x - x scaling vector
|
|
333
303
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
334
304
|
*/
|
|
@@ -338,8 +308,6 @@ import Matrix3d from './matrix3.js';
|
|
|
338
308
|
|
|
339
309
|
/**
|
|
340
310
|
* specifies a 2D scale operation using the [1,sy] scaling vector
|
|
341
|
-
* @name scaleY
|
|
342
|
-
* @memberof Matrix2d
|
|
343
311
|
* @param {number} y - y scaling vector
|
|
344
312
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
345
313
|
*/
|
|
@@ -349,8 +317,6 @@ import Matrix3d from './matrix3.js';
|
|
|
349
317
|
|
|
350
318
|
/**
|
|
351
319
|
* rotate the matrix (counter-clockwise) by the specified angle (in radians).
|
|
352
|
-
* @name rotate
|
|
353
|
-
* @memberof Matrix2d
|
|
354
320
|
* @param {number} angle - Rotation angle in radians.
|
|
355
321
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
356
322
|
*/
|
|
@@ -379,18 +345,8 @@ import Matrix3d from './matrix3.js';
|
|
|
379
345
|
|
|
380
346
|
/**
|
|
381
347
|
* translate the matrix position on the horizontal and vertical axis
|
|
382
|
-
* @
|
|
383
|
-
* @
|
|
384
|
-
* @method
|
|
385
|
-
* @param {number} x - the x coordindates to translate the matrix by
|
|
386
|
-
* @param {number} y - the y coordindates to translate the matrix by
|
|
387
|
-
* @returns {Matrix2d} Reference to this object for method chaining
|
|
388
|
-
*/
|
|
389
|
-
/**
|
|
390
|
-
* translate the matrix by a vector on the horizontal and vertical axis
|
|
391
|
-
* @name translateV
|
|
392
|
-
* @memberof Matrix2d
|
|
393
|
-
* @param {Vector2d} v - the vector to translate the matrix by
|
|
348
|
+
* @param {number|Vector2d} x - the x coordindates or a vector to translate the matrix by
|
|
349
|
+
* @param {number} [y] - the y coordindates to translate the matrix by
|
|
394
350
|
* @returns {Matrix2d} Reference to this object for method chaining
|
|
395
351
|
*/
|
|
396
352
|
translate() {
|
|
@@ -415,8 +371,6 @@ import Matrix3d from './matrix3.js';
|
|
|
415
371
|
|
|
416
372
|
/**
|
|
417
373
|
* returns true if the matrix is an identity matrix.
|
|
418
|
-
* @name isIdentity
|
|
419
|
-
* @memberof Matrix2d
|
|
420
374
|
* @returns {boolean}
|
|
421
375
|
*/
|
|
422
376
|
isIdentity() {
|
|
@@ -437,8 +391,6 @@ import Matrix3d from './matrix3.js';
|
|
|
437
391
|
|
|
438
392
|
/**
|
|
439
393
|
* return true if the two matrices are identical
|
|
440
|
-
* @name equals
|
|
441
|
-
* @memberof Matrix2d
|
|
442
394
|
* @param {Matrix2d} m - the other matrix
|
|
443
395
|
* @returns {boolean} true if both are equals
|
|
444
396
|
*/
|
|
@@ -461,8 +413,6 @@ import Matrix3d from './matrix3.js';
|
|
|
461
413
|
|
|
462
414
|
/**
|
|
463
415
|
* Clone the Matrix
|
|
464
|
-
* @name clone
|
|
465
|
-
* @memberof Matrix2d
|
|
466
416
|
* @returns {Matrix2d}
|
|
467
417
|
*/
|
|
468
418
|
clone() {
|
|
@@ -471,8 +421,6 @@ import Matrix3d from './matrix3.js';
|
|
|
471
421
|
|
|
472
422
|
/**
|
|
473
423
|
* return an array representation of this Matrix
|
|
474
|
-
* @name toArray
|
|
475
|
-
* @memberof Matrix2d
|
|
476
424
|
* @returns {Float32Array}
|
|
477
425
|
*/
|
|
478
426
|
toArray() {
|
|
@@ -481,8 +429,6 @@ import Matrix3d from './matrix3.js';
|
|
|
481
429
|
|
|
482
430
|
/**
|
|
483
431
|
* convert the object to a string representation
|
|
484
|
-
* @name toString
|
|
485
|
-
* @memberof Matrix2d
|
|
486
432
|
* @returns {string}
|
|
487
433
|
*/
|
|
488
434
|
toString() {
|