melonjs 9.1.0 → 10.0.1
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/{LICENSE → LICENSE.md} +0 -0
- package/README.md +93 -57
- package/dist/melonjs.js +10334 -11179
- package/dist/melonjs.min.js +4 -10
- package/dist/melonjs.module.d.ts +13206 -0
- package/dist/melonjs.module.js +9913 -10872
- package/package.json +19 -14
- package/src/audio/audio.js +477 -553
- package/src/camera/camera2d.js +67 -65
- package/src/entity/draggable.js +26 -35
- package/src/entity/droptarget.js +17 -14
- package/src/entity/entity.js +59 -79
- package/src/game.js +194 -204
- package/src/index.js +12 -30
- package/src/input/gamepad.js +8 -19
- package/src/input/keyboard.js +4 -4
- package/src/input/pointer.js +14 -12
- package/src/input/pointerevent.js +15 -13
- package/src/lang/deprecated.js +2 -887
- package/src/level/level.js +3 -3
- package/src/level/tiled/TMXGroup.js +7 -11
- package/src/level/tiled/TMXLayer.js +33 -32
- package/src/level/tiled/TMXTileMap.js +15 -19
- package/src/level/tiled/TMXTileset.js +5 -5
- package/src/level/tiled/TMXUtils.js +3 -3
- package/src/level/tiled/renderer/TMXRenderer.js +4 -0
- package/src/loader/loader.js +8 -23
- package/src/loader/loadingscreen.js +51 -60
- package/src/math/matrix3.js +1 -1
- package/src/particles/emitter.js +36 -39
- package/src/particles/particle.js +27 -12
- package/src/particles/particlecontainer.js +17 -16
- package/src/physics/body.js +80 -118
- package/src/physics/collision.js +5 -235
- package/src/physics/detector.js +235 -0
- package/src/physics/quadtree.js +14 -14
- package/src/physics/world.js +84 -18
- package/src/plugin/plugin.js +26 -24
- package/src/polyfill/console.js +9 -14
- package/src/renderable/GUI.js +48 -62
- package/src/renderable/collectable.js +11 -4
- package/src/renderable/colorlayer.js +28 -26
- package/src/renderable/container.js +120 -96
- package/src/renderable/imagelayer.js +94 -93
- package/src/renderable/renderable.js +164 -138
- package/src/renderable/sprite.js +42 -44
- package/src/renderable/trigger.js +24 -17
- package/src/shapes/ellipse.js +27 -27
- package/src/shapes/line.js +12 -8
- package/src/shapes/poly.js +77 -49
- package/src/shapes/rectangle.js +193 -268
- package/src/state/stage.js +23 -25
- package/src/state/state.js +35 -86
- package/src/system/device.js +233 -285
- package/src/system/event.js +485 -432
- package/src/system/pooling.js +61 -54
- package/src/system/save.js +17 -16
- package/src/system/timer.js +34 -38
- package/src/text/bitmaptext.js +44 -46
- package/src/text/text.js +39 -34
- package/src/tweens/easing.js +0 -2
- package/src/tweens/interpolation.js +3 -8
- package/src/tweens/tween.js +332 -351
- package/src/utils/function.js +6 -8
- package/src/utils/utils.js +34 -30
- package/src/video/canvas/canvas_renderer.js +13 -8
- package/src/video/renderer.js +8 -7
- package/src/video/texture.js +8 -8
- package/src/video/texture_cache.js +5 -5
- package/src/video/video.js +373 -403
- package/src/video/webgl/glshader.js +2 -2
- package/src/video/webgl/webgl_compositor.js +14 -8
- package/src/video/webgl/webgl_renderer.js +21 -19
- package/plugins/debug/debugPanel.js +0 -770
- package/plugins/debug/font/PressStart2P.fnt +0 -100
- package/plugins/debug/font/PressStart2P.ltr +0 -1
- package/plugins/debug/font/PressStart2P.png +0 -0
- package/plugins/debug/particleDebugPanel.js +0 -303
package/src/lang/deprecated.js
CHANGED
|
@@ -54,890 +54,5 @@ export function warning(deprecated, replacement, version) {
|
|
|
54
54
|
* @function apply
|
|
55
55
|
*/
|
|
56
56
|
export function apply() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* @function me.device.getPixelRatio
|
|
60
|
-
* @deprecated since 5.1.0
|
|
61
|
-
* @see me.device.devicePixelRatio
|
|
62
|
-
*/
|
|
63
|
-
me.device.getPixelRatio = function() {
|
|
64
|
-
warning("me.device.getPixelRatio()", "me.device.devicePixelRatio", "5.1.0");
|
|
65
|
-
return me.device.devicePixelRatio;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @class me.Font
|
|
70
|
-
* @deprecated since 6.1.0
|
|
71
|
-
* @see me.Text
|
|
72
|
-
*/
|
|
73
|
-
me.Font = me.Text.extend({
|
|
74
|
-
/** @ignore */
|
|
75
|
-
init: function (font, size, fillStyle, textAlign) {
|
|
76
|
-
var settings = {
|
|
77
|
-
font:font,
|
|
78
|
-
size:size,
|
|
79
|
-
fillStyle:fillStyle,
|
|
80
|
-
textAlign:textAlign
|
|
81
|
-
};
|
|
82
|
-
// super constructor
|
|
83
|
-
this._super(me.Text, "init", [0, 0, settings]);
|
|
84
|
-
// deprecation warning
|
|
85
|
-
warning("me.Font", "me.Text", "6.1.0");
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
/** @ignore */
|
|
89
|
-
setFont : function (font, size, fillStyle, textAlign) {
|
|
90
|
-
// apply fillstyle if defined
|
|
91
|
-
if (typeof(fillStyle) !== "undefined") {
|
|
92
|
-
this.fillStyle.copy(fillStyle);
|
|
93
|
-
}
|
|
94
|
-
// h alignement if defined
|
|
95
|
-
if (typeof(textAlign) !== "undefined") {
|
|
96
|
-
this.textAlign = textAlign;
|
|
97
|
-
}
|
|
98
|
-
// super constructor
|
|
99
|
-
return this._super(me.Text, "setFont", [font, size]);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @ignore
|
|
105
|
-
*/
|
|
106
|
-
me.BitmapFontData = me.BitmapTextData;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* @class me.BitmapFont
|
|
110
|
-
* @deprecated since 6.1.0
|
|
111
|
-
* @see me.BitmapText
|
|
112
|
-
*/
|
|
113
|
-
me.BitmapFont = me.BitmapText.extend({
|
|
114
|
-
/** @ignore */
|
|
115
|
-
init: function (data, fontImage, scale, textAlign, textBaseline) {
|
|
116
|
-
var settings = {
|
|
117
|
-
font: fontImage,
|
|
118
|
-
fontData: data,
|
|
119
|
-
size: scale,
|
|
120
|
-
textAlign: textAlign,
|
|
121
|
-
textBaseline: textBaseline
|
|
122
|
-
};
|
|
123
|
-
// super constructor
|
|
124
|
-
this._super(me.BitmapText, "init", [0, 0, settings]);
|
|
125
|
-
// deprecation warning
|
|
126
|
-
warning("me.BitmapFont", "me.BitmapText", "6.1.0");
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* @class me.ScreenObject
|
|
132
|
-
* @deprecated since 6.2.0
|
|
133
|
-
* @see me.Stage
|
|
134
|
-
*/
|
|
135
|
-
me.ScreenObject = me.Stage.extend({
|
|
136
|
-
/** @ignore */
|
|
137
|
-
init: function (settings) {
|
|
138
|
-
// super constructor
|
|
139
|
-
this._super(me.Stage, "init", [settings]);
|
|
140
|
-
// deprecation warning
|
|
141
|
-
warning("me.ScreenObject", "me.Stage", "6.2.0");
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* @function me.Renderer.drawShape
|
|
147
|
-
* @deprecated since 6.3.0
|
|
148
|
-
* @see me.Renderer.stroke
|
|
149
|
-
*/
|
|
150
|
-
me.Renderer.prototype.drawShape = function () {
|
|
151
|
-
warning("drawShape()", "the stroke() or fill()", "6.3.0");
|
|
152
|
-
me.Renderer.prototype.stroke.apply(this, arguments);
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* @function me.video.getPos
|
|
157
|
-
* @deprecated since 7.0.0
|
|
158
|
-
* @see me.device.getElementBounds
|
|
159
|
-
*/
|
|
160
|
-
me.video.getPos = function() {
|
|
161
|
-
warning("me.video.getPos()", "me.device.getElementBounds(me.video.renderer.getScreenCanvas());", "7.0.0");
|
|
162
|
-
return me.device.getElementBounds(me.video.renderer.getScreenCanvas());
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* @classdesc
|
|
167
|
-
* melonJS base class for exception handling.
|
|
168
|
-
* @class
|
|
169
|
-
* @memberOf me
|
|
170
|
-
* @constructor
|
|
171
|
-
* @deprecated since 7.0.0
|
|
172
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
|
|
173
|
-
* @param {String} msg Error message.
|
|
174
|
-
* @example
|
|
175
|
-
* throw new me.Error("Guru Meditation");
|
|
176
|
-
*/
|
|
177
|
-
me.Error = function(msg) {
|
|
178
|
-
var err = new Error();
|
|
179
|
-
err.name = "me.Error";
|
|
180
|
-
err.message = msg;
|
|
181
|
-
return err;
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* @namespace me.sys
|
|
186
|
-
* @deprecated since 9.0.0
|
|
187
|
-
*/
|
|
188
|
-
me.sys = me.sys || {};
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* @function me.sys.checkVersion
|
|
192
|
-
* @deprecated since 7.1.0
|
|
193
|
-
* @see me.utils.checkVersion
|
|
194
|
-
*/
|
|
195
|
-
me.sys.checkVersion = function(first, second) {
|
|
196
|
-
warning("me.sys.checkVersion()", "me.utils.checkVersion()", "7.1.0");
|
|
197
|
-
return me.utils.checkVersion(first, second);
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* @public
|
|
202
|
-
* @type {Object}
|
|
203
|
-
* @name HASH
|
|
204
|
-
* @memberOf me.game
|
|
205
|
-
* @deprecated since 7.1.0
|
|
206
|
-
* @see me.utils.getUriFragment
|
|
207
|
-
*/
|
|
208
|
-
Object.defineProperty(me.game, "HASH", {
|
|
209
|
-
/**
|
|
210
|
-
* @ignore
|
|
211
|
-
*/
|
|
212
|
-
get : function () {
|
|
213
|
-
warning("me.game.HASH", "me.utils.getUriFragment()", "7.1.0");
|
|
214
|
-
return me.utils.getUriFragment();
|
|
215
|
-
},
|
|
216
|
-
configurable : false
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* @function me.video.updateDisplaySize
|
|
221
|
-
* @deprecated since 7.1.0
|
|
222
|
-
* @see me.video.scale
|
|
223
|
-
*/
|
|
224
|
-
me.video.updateDisplaySize = function(x, y) {
|
|
225
|
-
warning("me.video.updateDisplaySize()", "me.video.scale()", "7.1.0");
|
|
226
|
-
return me.video.scale(x, y);
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* @function me.Renderer.scaleCanvas
|
|
231
|
-
* @deprecated since 7.1.0
|
|
232
|
-
* @see me.video.scale
|
|
233
|
-
*/
|
|
234
|
-
me.Renderer.prototype.scaleCanvas = function (x, y) {
|
|
235
|
-
warning("scaleCanvas()", "me.video.scale()", "7.1.0");
|
|
236
|
-
return me.video.scale(x, y);
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* @function me.Entity.distanceToPoint
|
|
241
|
-
* @deprecated since 7.1.0
|
|
242
|
-
* @see me.Renderable.distanceTo
|
|
243
|
-
*/
|
|
244
|
-
me.Entity.prototype.distanceToPoint = function (v) {
|
|
245
|
-
warning("distanceToPoint()", "me.Renderable.distanceTo()", "7.1.0");
|
|
246
|
-
return this.distanceTo(v);
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* @function me.Entity.angleToPoint
|
|
251
|
-
* @deprecated since 7.1.0
|
|
252
|
-
* @see me.Renderable.angleTo
|
|
253
|
-
*/
|
|
254
|
-
me.Entity.prototype.angleToPoint = function (v) {
|
|
255
|
-
warning("angleToPoint()", "me.Renderable.angleTo()", "7.1.0");
|
|
256
|
-
return this.angleTo(v);
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* @public
|
|
261
|
-
* @type {Number}
|
|
262
|
-
* @name gravity
|
|
263
|
-
* @memberOf me.sys
|
|
264
|
-
* @deprecated since 8.0.0
|
|
265
|
-
* @see me.World.gravity
|
|
266
|
-
*/
|
|
267
|
-
Object.defineProperty(me.sys, "gravity", {
|
|
268
|
-
/**
|
|
269
|
-
* @ignore
|
|
270
|
-
*/
|
|
271
|
-
get : function () {
|
|
272
|
-
warning("me.sys.gravity", "me.game.world.gravity", "8.0.0");
|
|
273
|
-
return me.game.world ? me.game.world.gravity.y : undefined;
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* @ignore
|
|
278
|
-
*/
|
|
279
|
-
set : function (value) {
|
|
280
|
-
warning("me.sys.gravity", "me.game.world.gravity", "8.0.0");
|
|
281
|
-
if (me.game.world) me.game.world.gravity.y = value;
|
|
282
|
-
},
|
|
283
|
-
configurable : false
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* @ignore
|
|
288
|
-
*/
|
|
289
|
-
me.WebGLRenderer.Compositor = me.WebGLCompositor;
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Draw triangle(s)
|
|
293
|
-
* @name drawTriangle
|
|
294
|
-
* @deprecated since 8.0.0
|
|
295
|
-
* @see me.WebGLRenderer.Compositor
|
|
296
|
-
* @memberOf me.WebGLRenderer.Compositor.drawVertices
|
|
297
|
-
* @function
|
|
298
|
-
* @param {me.Vector2d[]} points vertices
|
|
299
|
-
* @param {Number} [len=points.length] amount of points defined in the points array
|
|
300
|
-
* @param {Boolean} [strip=false] Whether the array defines a serie of connected triangles, sharing vertices
|
|
301
|
-
*/
|
|
302
|
-
me.WebGLRenderer.Compositor.prototype.drawTriangle = function (points, len, strip) {
|
|
303
|
-
var gl = this.gl;
|
|
304
|
-
this.drawVertices(strip === true ? gl.TRIANGLE_STRIP : gl.TRIANGLES, points, len);
|
|
305
|
-
warning("drawTriangle()", "drawVertices()", "8.0.0");
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Draw a line
|
|
310
|
-
* @name drawLine
|
|
311
|
-
* @deprecated since 8.0.0
|
|
312
|
-
* @memberOf me.WebGLRenderer.Compositor.drawVertices
|
|
313
|
-
* @memberOf me.WebGLRenderer.Compositor
|
|
314
|
-
* @function
|
|
315
|
-
* @param {me.Vector2d[]} points Line vertices
|
|
316
|
-
* @param {Number} [len=points.length] amount of points defined in the points array
|
|
317
|
-
* @param {Boolean} [open=false] Whether the line is open (true) or closed (false)
|
|
318
|
-
*/
|
|
319
|
-
me.WebGLRenderer.Compositor.prototype.drawLine = function (points, len, open) {
|
|
320
|
-
var gl = this.gl;
|
|
321
|
-
this.drawVertices(open === true ? gl.LINE_STRIP : gl.LINE_LOOP, points, len);
|
|
322
|
-
warning("drawLine()", "drawVertices()", "8.0.0");
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* @public
|
|
327
|
-
* @type {me.Vector2d}
|
|
328
|
-
* @name scale
|
|
329
|
-
* @memberOf me.sys
|
|
330
|
-
* @deprecated since 8.0.0
|
|
331
|
-
* @see me.video.scaleRatio
|
|
332
|
-
*/
|
|
333
|
-
Object.defineProperty(me.sys, "scale", {
|
|
334
|
-
/**
|
|
335
|
-
* @ignore
|
|
336
|
-
*/
|
|
337
|
-
get : function () {
|
|
338
|
-
warning("me.sys.scale", "me.video.scaleRatio", "8.0.0");
|
|
339
|
-
return me.video.scaleRatio;
|
|
340
|
-
},
|
|
341
|
-
configurable : false
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* @function me.video.getWrapper
|
|
346
|
-
* @deprecated since 8.0.0
|
|
347
|
-
* @see me.video.getParent
|
|
348
|
-
*/
|
|
349
|
-
me.video.getWrapper = function() {
|
|
350
|
-
warning("me.video.getWrapper()", "me.device.getParent()", "8.0.0");
|
|
351
|
-
return me.video.getParent();
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Set game FPS limiting
|
|
356
|
-
* @public
|
|
357
|
-
* @type {Number}
|
|
358
|
-
* @name fps
|
|
359
|
-
* @memberOf me.sys
|
|
360
|
-
* @deprecated since 8.0.0
|
|
361
|
-
* @see me.timer.maxfps
|
|
362
|
-
*/
|
|
363
|
-
Object.defineProperty(me.sys, "fps", {
|
|
364
|
-
/**
|
|
365
|
-
* @ignore
|
|
366
|
-
*/
|
|
367
|
-
get : function () {
|
|
368
|
-
warning("me.sys.fps", "me.timer.maxfps", "8.0.0");
|
|
369
|
-
return me.timer.maxfps;
|
|
370
|
-
},
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* @ignore
|
|
374
|
-
*/
|
|
375
|
-
set : function (value) {
|
|
376
|
-
warning("me.sys.fps", "me.timer.maxfps", "8.0.0");
|
|
377
|
-
me.timer.maxfps = value;
|
|
378
|
-
},
|
|
379
|
-
configurable : false
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Rate at which the game physic updates;
|
|
384
|
-
* may be greater than or lower than the display fps
|
|
385
|
-
* @public
|
|
386
|
-
* @type {Number}
|
|
387
|
-
* @name updatesPerSecond
|
|
388
|
-
* @memberOf me.sys
|
|
389
|
-
* @deprecated since 8.0.0
|
|
390
|
-
* @see me.World.fps
|
|
391
|
-
*/
|
|
392
|
-
Object.defineProperty(me.sys, "updatesPerSecond", {
|
|
393
|
-
/**
|
|
394
|
-
* @ignore
|
|
395
|
-
*/
|
|
396
|
-
get : function () {
|
|
397
|
-
warning("me.sys.updatesPerSecond", "me.game.world.fps", "8.0.0");
|
|
398
|
-
return me.game.world.fps;
|
|
399
|
-
},
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* @ignore
|
|
403
|
-
*/
|
|
404
|
-
set : function (value) {
|
|
405
|
-
warning("me.sys.updatesPerSecond", "me.game.world.fps", "8.0.0");
|
|
406
|
-
me.game.world.fps = value;
|
|
407
|
-
},
|
|
408
|
-
configurable : false
|
|
409
|
-
});
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* Enable/disable frame interpolation
|
|
413
|
-
* @public
|
|
414
|
-
* @type {Boolean}
|
|
415
|
-
* @name interpolation
|
|
416
|
-
* @memberOf me.sys
|
|
417
|
-
* @deprecated since 8.0.0
|
|
418
|
-
* @see me.timer.interpolation
|
|
419
|
-
*/
|
|
420
|
-
Object.defineProperty(me.sys, "interpolation", {
|
|
421
|
-
/**
|
|
422
|
-
* @ignore
|
|
423
|
-
*/
|
|
424
|
-
get : function () {
|
|
425
|
-
warning("me.sys.interpolation", "me.timer.interpolation", "8.0.0");
|
|
426
|
-
return me.timer.interpolation;
|
|
427
|
-
},
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* @ignore
|
|
431
|
-
*/
|
|
432
|
-
set : function (value) {
|
|
433
|
-
warning("me.sys.interpolation", "me.timer.interpolation", "8.0.0");
|
|
434
|
-
me.timer.interpolation = value;
|
|
435
|
-
},
|
|
436
|
-
configurable : false
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
/**
|
|
440
|
-
* add collision mesh based on a given Physics Editor JSON object
|
|
441
|
-
* @name addShapesFromJSON
|
|
442
|
-
* @deprecated since 8.0.0
|
|
443
|
-
* @see me.Body.fromJSON
|
|
444
|
-
* @memberOf me.Body
|
|
445
|
-
* @function
|
|
446
|
-
* @param {me.Rect|me.Polygon|me.Line|me.Ellipse|Object} shape a shape or JSON object
|
|
447
|
-
* @param {Boolean} batchInsert if true the body bounds won't be updated after adding a shape
|
|
448
|
-
* @return {Number} the shape array length
|
|
449
|
-
*/
|
|
450
|
-
me.Body.prototype.addShapesFromJSON = function (json, id) {
|
|
451
|
-
warning("addShapesFromJSON()", "fromJSON()", "8.0.0");
|
|
452
|
-
return this.fromJSON(json, id);
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* Specify either to stop on audio loading error or not
|
|
457
|
-
* @public
|
|
458
|
-
* @type {Boolean}
|
|
459
|
-
* @name stopOnAudioError
|
|
460
|
-
* @memberOf me.sys
|
|
461
|
-
* @deprecated since 9.0.0
|
|
462
|
-
* @see me.audio.interpolation
|
|
463
|
-
*/
|
|
464
|
-
Object.defineProperty(me.sys, "stopOnAudioError", {
|
|
465
|
-
/**
|
|
466
|
-
* @ignore
|
|
467
|
-
*/
|
|
468
|
-
get : function () {
|
|
469
|
-
warning("me.sys.stopOnAudioError", "me.audio.stopOnAudioError", "9.0.0");
|
|
470
|
-
return me.audio.stopOnAudioError;
|
|
471
|
-
},
|
|
472
|
-
|
|
473
|
-
/**
|
|
474
|
-
* @ignore
|
|
475
|
-
*/
|
|
476
|
-
set : function (value) {
|
|
477
|
-
warning("me.sys.stopOnAudioError", "me.audio.stopOnAudioError", "9.0.0");
|
|
478
|
-
me.audio.stopOnAudioError = value;
|
|
479
|
-
},
|
|
480
|
-
configurable : false
|
|
481
|
-
});
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* Specify whether to pause the game when losing focus
|
|
485
|
-
* @public
|
|
486
|
-
* @type {Boolean}
|
|
487
|
-
* @name pauseOnBlur
|
|
488
|
-
* @memberOf me.sys
|
|
489
|
-
* @deprecated since 9.0.0
|
|
490
|
-
* @see me.device.pauseOnBlur
|
|
491
|
-
*/
|
|
492
|
-
Object.defineProperty(me.sys, "pauseOnBlur", {
|
|
493
|
-
/**
|
|
494
|
-
* @ignore
|
|
495
|
-
*/
|
|
496
|
-
get : function () {
|
|
497
|
-
warning("me.sys.pauseOnBlur", "me.device.pauseOnBlur", "9.0.0");
|
|
498
|
-
return me.audio.pauseOnBlur;
|
|
499
|
-
},
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* @ignore
|
|
503
|
-
*/
|
|
504
|
-
set : function (value) {
|
|
505
|
-
warning("me.sys.pauseOnBlur", "me.device.pauseOnBlur", "9.0.0");
|
|
506
|
-
me.device.pauseOnBlur = value;
|
|
507
|
-
},
|
|
508
|
-
configurable : false
|
|
509
|
-
});
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* Specify whether to unpause the game when gaining focus
|
|
513
|
-
* @public
|
|
514
|
-
* @type {Boolean}
|
|
515
|
-
* @name resumeOnFocus
|
|
516
|
-
* @memberOf me.sys
|
|
517
|
-
* @deprecated since 9.0.0
|
|
518
|
-
* @see me.device.resumeOnFocus
|
|
519
|
-
*/
|
|
520
|
-
Object.defineProperty(me.sys, "resumeOnFocus", {
|
|
521
|
-
/**
|
|
522
|
-
* @ignore
|
|
523
|
-
*/
|
|
524
|
-
get : function () {
|
|
525
|
-
warning("me.sys.pauseOnBlur", "me.device.resumeOnFocus", "9.0.0");
|
|
526
|
-
return me.device.resumeOnFocus;
|
|
527
|
-
},
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* @ignore
|
|
531
|
-
*/
|
|
532
|
-
set : function (value) {
|
|
533
|
-
warning("me.sys.pauseOnBlur", "me.device.resumeOnFocus", "9.0.0");
|
|
534
|
-
me.device.resumeOnFocus = value;
|
|
535
|
-
},
|
|
536
|
-
configurable : false
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* Specify whether to automatically bring the window to the front
|
|
541
|
-
* @public
|
|
542
|
-
* @type {Boolean}
|
|
543
|
-
* @name autoFocus
|
|
544
|
-
* @memberOf me.sys
|
|
545
|
-
* @deprecated since 9.0.0
|
|
546
|
-
* @see me.device.autoFocus
|
|
547
|
-
*/
|
|
548
|
-
Object.defineProperty(me.sys, "autoFocus", {
|
|
549
|
-
/**
|
|
550
|
-
* @ignore
|
|
551
|
-
*/
|
|
552
|
-
get : function () {
|
|
553
|
-
warning("me.sys.autoFocus", "me.device.autoFocus", "9.0.0");
|
|
554
|
-
return me.device.autoFocus;
|
|
555
|
-
},
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* @ignore
|
|
559
|
-
*/
|
|
560
|
-
set : function (value) {
|
|
561
|
-
warning("me.sys.autoFocus", "me.device.autoFocus", "9.0.0");
|
|
562
|
-
me.device.autoFocus = value;
|
|
563
|
-
},
|
|
564
|
-
configurable : false
|
|
565
|
-
});
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* Specify whether to stop the game when losing focus or not
|
|
569
|
-
* @public
|
|
570
|
-
* @type {Boolean}
|
|
571
|
-
* @name pauseOnBlur
|
|
572
|
-
* @memberOf me.sys
|
|
573
|
-
* @deprecated since 9.0.0
|
|
574
|
-
* @see me.device.pauseOnBlur
|
|
575
|
-
*/
|
|
576
|
-
Object.defineProperty(me.sys, "stopOnBlur", {
|
|
577
|
-
/**
|
|
578
|
-
* @ignore
|
|
579
|
-
*/
|
|
580
|
-
get : function () {
|
|
581
|
-
warning("me.sys.pauseOnBlur", "me.device.stopOnBlur", "9.0.0");
|
|
582
|
-
return me.device.stopOnBlur;
|
|
583
|
-
},
|
|
584
|
-
|
|
585
|
-
/**
|
|
586
|
-
* @ignore
|
|
587
|
-
*/
|
|
588
|
-
set : function (value) {
|
|
589
|
-
warning("me.sys.pauseOnBlur", "me.device.stopOnBlur", "9.0.0");
|
|
590
|
-
me.device.stopOnBlur = value;
|
|
591
|
-
},
|
|
592
|
-
configurable : false
|
|
593
|
-
});
|
|
594
|
-
|
|
595
|
-
/**
|
|
596
|
-
* Specify the rendering method for tiled layers
|
|
597
|
-
* @public
|
|
598
|
-
* @type {Boolean}
|
|
599
|
-
* @name preRender
|
|
600
|
-
* @memberOf me.sys
|
|
601
|
-
* @deprecated since 9.0.0
|
|
602
|
-
* @see me.game.world.preRender
|
|
603
|
-
*/
|
|
604
|
-
Object.defineProperty(me.sys, "preRender", {
|
|
605
|
-
/**
|
|
606
|
-
* @ignore
|
|
607
|
-
*/
|
|
608
|
-
get : function () {
|
|
609
|
-
warning("me.sys.preRender", "me.game.world.preRender", "9.0.0");
|
|
610
|
-
return me.game.world.stopOnBlur;
|
|
611
|
-
},
|
|
612
|
-
|
|
613
|
-
/**
|
|
614
|
-
* @ignore
|
|
615
|
-
*/
|
|
616
|
-
set : function (value) {
|
|
617
|
-
warning("me.sys.preRender", "me.game.world.preRender", "9.0.0");
|
|
618
|
-
me.game.world.stopOnBlur = value;
|
|
619
|
-
},
|
|
620
|
-
configurable : false
|
|
621
|
-
});
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* @namespace me.levelDirector
|
|
625
|
-
* @deprecated since 9.0.0
|
|
626
|
-
* @see me.level
|
|
627
|
-
*/
|
|
628
|
-
me.levelDirector = me.levelDirector || {};
|
|
629
|
-
|
|
630
|
-
/**
|
|
631
|
-
* @function me.levelDirector.loadLevel
|
|
632
|
-
* @deprecated since 9.0.0
|
|
633
|
-
* @see me.level.load
|
|
634
|
-
*/
|
|
635
|
-
me.levelDirector.loadLevel = function(levelId, options) {
|
|
636
|
-
warning("me.levelDirector.loadLevel()", "me.level.load()", "9.0.0");
|
|
637
|
-
return me.level.load(levelId, options);
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
/**
|
|
641
|
-
* @function me.levelDirector.getCurrentLevelId
|
|
642
|
-
* @deprecated since 9.0.0
|
|
643
|
-
* @see me.level.getCurrentLevelId
|
|
644
|
-
*/
|
|
645
|
-
me.levelDirector.getCurrentLevelId = function() {
|
|
646
|
-
warning("me.levelDirector.getCurrentLevelId()", "me.level.getCurrentLevelId()", "9.0.0");
|
|
647
|
-
return me.level.getCurrentLevelId();
|
|
648
|
-
};
|
|
649
|
-
|
|
650
|
-
/**
|
|
651
|
-
* @function me.levelDirector.getCurrentLevel
|
|
652
|
-
* @deprecated since 9.0.0
|
|
653
|
-
* @see me.level.load
|
|
654
|
-
*/
|
|
655
|
-
me.levelDirector.getCurrentLevel = function() {
|
|
656
|
-
warning("me.levelDirector.getCurrentLevel()", "me.level.getCurrentLevel()", "9.0.0");
|
|
657
|
-
return me.level.getCurrentLevel();
|
|
658
|
-
};
|
|
659
|
-
|
|
660
|
-
/**
|
|
661
|
-
* @function me.levelDirector.reloadLevel
|
|
662
|
-
* @deprecated since 9.0.0
|
|
663
|
-
* @see me.level.reload
|
|
664
|
-
*/
|
|
665
|
-
me.levelDirector.reloadLevel = function(options) {
|
|
666
|
-
warning("me.levelDirector.reloadLevel()", "me.level.reload()", "9.0.0");
|
|
667
|
-
return me.level.reload(options);
|
|
668
|
-
};
|
|
669
|
-
|
|
670
|
-
/**
|
|
671
|
-
* @function me.levelDirector.nextLevel
|
|
672
|
-
* @deprecated since 9.0.0
|
|
673
|
-
* @see me.level.load
|
|
674
|
-
*/
|
|
675
|
-
me.levelDirector.nextLevel = function(options) {
|
|
676
|
-
warning("me.levelDirector.nextLevel()", "me.level.next()", "9.0.0");
|
|
677
|
-
return me.level.next(options);
|
|
678
|
-
};
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* @function me.levelDirector.previousLevel
|
|
682
|
-
* @deprecated since 9.0.0
|
|
683
|
-
* @see me.level.load
|
|
684
|
-
*/
|
|
685
|
-
me.levelDirector.previousLevel = function(options) {
|
|
686
|
-
warning("me.levelDirector.previousLevel()", "me.level.previous()", "9.0.0");
|
|
687
|
-
return me.level.previous(options);
|
|
688
|
-
};
|
|
689
|
-
|
|
690
|
-
/**
|
|
691
|
-
* @function me.levelDirector.levelCount
|
|
692
|
-
* @deprecated since 9.0.0
|
|
693
|
-
* @see me.level.levelCount
|
|
694
|
-
*/
|
|
695
|
-
me.levelDirector.levelCount = function() {
|
|
696
|
-
warning("me.levelDirector.levelCount()", "me.level.levelCount()", "9.0.0");
|
|
697
|
-
return me.level.levelCount();
|
|
698
|
-
};
|
|
699
|
-
|
|
700
|
-
/**
|
|
701
|
-
* translate the rect by the specified vector
|
|
702
|
-
* @name translate
|
|
703
|
-
* @memberOf me.Rect.prototype
|
|
704
|
-
* @function
|
|
705
|
-
* @deprecated since 9.0.0
|
|
706
|
-
* @see me.Rect.translate
|
|
707
|
-
* @param {me.Vector2d} v vector offset
|
|
708
|
-
* @return {me.Rect} this rectangle
|
|
709
|
-
*/
|
|
710
|
-
me.Rect.prototype.translateV = function (v) {
|
|
711
|
-
warning("translateV()", "translate()", "9.0.0");
|
|
712
|
-
return this.translate(v);
|
|
713
|
-
};
|
|
714
|
-
|
|
715
|
-
/**
|
|
716
|
-
* Returns true if the rectangle contains the given point
|
|
717
|
-
* @name containsPoint
|
|
718
|
-
* @memberOf me.Rect.prototype
|
|
719
|
-
* @function
|
|
720
|
-
* @deprecated since 9.0.0
|
|
721
|
-
* @see me.Rect.contains
|
|
722
|
-
* @param {Number} x x coordinate
|
|
723
|
-
* @param {Number} y y coordinate
|
|
724
|
-
* @return {boolean} true if contains
|
|
725
|
-
*/
|
|
726
|
-
me.Rect.prototype.containsPoint = function (x, y) {
|
|
727
|
-
warning("containsPoint()", "contains()", "9.0.0");
|
|
728
|
-
return this.contains(x, y);
|
|
729
|
-
};
|
|
730
|
-
|
|
731
|
-
/**
|
|
732
|
-
* translate the Polygon by the specified vector
|
|
733
|
-
* @name translateV
|
|
734
|
-
* @memberOf me.Polygon.prototype
|
|
735
|
-
* @function
|
|
736
|
-
* @deprecated since 9.0.0
|
|
737
|
-
* @see me.Polygon.translate
|
|
738
|
-
* @param {me.Vector2d} v vector offset
|
|
739
|
-
* @return {me.Polygon} Reference to this object for method chaining
|
|
740
|
-
*/
|
|
741
|
-
me.Polygon.prototype.translateV = function (v) {
|
|
742
|
-
warning("translateV()", "translate()", "9.0.0");
|
|
743
|
-
return this.translate(v);
|
|
744
|
-
};
|
|
745
|
-
|
|
746
|
-
/**
|
|
747
|
-
* check if this Polygon contains the specified point
|
|
748
|
-
* @name containsPointV
|
|
749
|
-
* @memberOf me.Polygon.prototype
|
|
750
|
-
* @function
|
|
751
|
-
* @deprecated since 9.0.0
|
|
752
|
-
* @see me.Polygon.contains
|
|
753
|
-
* @param {me.Vector2d} point
|
|
754
|
-
* @return {boolean} true if contains
|
|
755
|
-
*/
|
|
756
|
-
me.Polygon.prototype.containsPointV = function (v) {
|
|
757
|
-
warning("containsPointV()", "contains()", "9.0.0");
|
|
758
|
-
return this.contains(v);
|
|
759
|
-
};
|
|
760
|
-
|
|
761
|
-
/**
|
|
762
|
-
* Returns true if the polygon contains the given point. <br>
|
|
763
|
-
* (Note: it is highly recommended to first do a hit test on the corresponding <br>
|
|
764
|
-
* bounding rect, as the function can be highly consuming with complex shapes)
|
|
765
|
-
* @name containsPoint
|
|
766
|
-
* @memberOf me.Polygon.prototype
|
|
767
|
-
* @function
|
|
768
|
-
* @deprecated since 9.0.0
|
|
769
|
-
* @see me.Polygon.contains
|
|
770
|
-
* @param {Number} x x coordinate
|
|
771
|
-
* @param {Number} y y coordinate
|
|
772
|
-
* @return {boolean} true if contains
|
|
773
|
-
*/
|
|
774
|
-
|
|
775
|
-
me.Polygon.prototype.containsPoint = function (x, y) {
|
|
776
|
-
warning("containsPoint()", "contains()", "9.0.0");
|
|
777
|
-
return this.contains(x, y);
|
|
778
|
-
};
|
|
779
|
-
|
|
780
|
-
/**
|
|
781
|
-
* check if this Line contains the specified point
|
|
782
|
-
* @name containsPointV
|
|
783
|
-
* @memberOf me.Line.prototype
|
|
784
|
-
* @function
|
|
785
|
-
* @deprecated since 9.0.0
|
|
786
|
-
* @see me.Line.contains
|
|
787
|
-
* @param {me.Vector2d} point
|
|
788
|
-
* @return {boolean} true if contains
|
|
789
|
-
*/
|
|
790
|
-
me.Line.prototype.containsPointV = function (v) {
|
|
791
|
-
warning("containsPointV()", "contains()", "9.0.0");
|
|
792
|
-
return this.contains(v);
|
|
793
|
-
};
|
|
794
|
-
|
|
795
|
-
/**
|
|
796
|
-
* Returns true if the Line contains the given point. <br>
|
|
797
|
-
* (Note: it is highly recommended to first do a hit test on the corresponding <br>
|
|
798
|
-
* bounding rect, as the function can be highly consuming with complex shapes)
|
|
799
|
-
* @name containsPoint
|
|
800
|
-
* @memberOf me.Line.prototype
|
|
801
|
-
* @function
|
|
802
|
-
* @deprecated since 9.0.0
|
|
803
|
-
* @see me.Line.contains
|
|
804
|
-
* @param {Number} x x coordinate
|
|
805
|
-
* @param {Number} y y coordinate
|
|
806
|
-
* @return {boolean} true if contains
|
|
807
|
-
*/
|
|
808
|
-
me.Line.prototype.containsPoint = function (x, y) {
|
|
809
|
-
warning("containsPoint()", "contains()", "9.0.0");
|
|
810
|
-
return this.contains(x, y);
|
|
811
|
-
};
|
|
812
|
-
|
|
813
|
-
/**
|
|
814
|
-
* translate the circle/ellipse by the specified vector
|
|
815
|
-
* @name translateV
|
|
816
|
-
* @memberOf me.Ellipse.prototype
|
|
817
|
-
* @function
|
|
818
|
-
* @deprecated since 9.0.0
|
|
819
|
-
* @see me.Ellipse.translate
|
|
820
|
-
* @param {me.Vector2d} v vector offset
|
|
821
|
-
* @return {me.Rect} this ellipse
|
|
822
|
-
*/
|
|
823
|
-
me.Ellipse.prototype.translateV = function (v) {
|
|
824
|
-
warning("translateV()", "translate()", "9.0.0");
|
|
825
|
-
return this.translate(v);
|
|
826
|
-
};
|
|
827
|
-
|
|
828
|
-
/**
|
|
829
|
-
* check if this Ellipse contains the specified point
|
|
830
|
-
* @name containsPointV
|
|
831
|
-
* @memberOf me.Ellipse.prototype
|
|
832
|
-
* @function
|
|
833
|
-
* @deprecated since 9.0.0
|
|
834
|
-
* @see me.Ellipse.contains
|
|
835
|
-
* @param {me.Vector2d} point
|
|
836
|
-
* @return {boolean} true if contains
|
|
837
|
-
*/
|
|
838
|
-
me.Ellipse.prototype.containsPointV = function (v) {
|
|
839
|
-
warning("containsPointV()", "contains()", "9.0.0");
|
|
840
|
-
return this.contains(v);
|
|
841
|
-
};
|
|
842
|
-
|
|
843
|
-
/**
|
|
844
|
-
* Returns true if the Ellipse contains the given point
|
|
845
|
-
* @name containsPoint
|
|
846
|
-
* @memberOf me.Ellipse.prototype
|
|
847
|
-
* @function
|
|
848
|
-
* @deprecated since 9.0.0
|
|
849
|
-
* @see me.Ellipse.contains
|
|
850
|
-
* @param {Number} x x coordinate
|
|
851
|
-
* @param {Number} y y coordinate
|
|
852
|
-
* @return {boolean} true if contains
|
|
853
|
-
*/
|
|
854
|
-
me.Ellipse.prototype.containsPoint = function (x, y) {
|
|
855
|
-
warning("containsPoint()", "contains()", "9.0.0");
|
|
856
|
-
return this.contains(x, y);
|
|
857
|
-
};
|
|
858
|
-
|
|
859
|
-
/**
|
|
860
|
-
* translate the matrix by a vector on the horizontal and vertical axis
|
|
861
|
-
* @name translateV
|
|
862
|
-
* @memberOf me.Matrix2d
|
|
863
|
-
* @function
|
|
864
|
-
* @deprecated since 9.0.0
|
|
865
|
-
* @see me.Matrix2d.translate
|
|
866
|
-
* @param {me.Vector2d} v the vector to translate the matrix by
|
|
867
|
-
* @return {me.Matrix2d} Reference to this object for method chaining
|
|
868
|
-
*/
|
|
869
|
-
me.Matrix2d.prototype.translateV = function (v) {
|
|
870
|
-
warning("translateV()", "translate()", "9.0.0");
|
|
871
|
-
return this.translate(v);
|
|
872
|
-
};
|
|
873
|
-
|
|
874
|
-
/**
|
|
875
|
-
* translate the matrix by a vector on the horizontal and vertical axis
|
|
876
|
-
* @name translateV
|
|
877
|
-
* @memberOf me.Matrix3d
|
|
878
|
-
* @function
|
|
879
|
-
* @deprecated since 9.0.0
|
|
880
|
-
* @see me.Matrix3d.translate
|
|
881
|
-
* @param {me.Vector2d|me.Vector3d} v the vector to translate the matrix by
|
|
882
|
-
* @return {me.Matrix3d} Reference to this object for method chaining
|
|
883
|
-
*/
|
|
884
|
-
me.Matrix3d.prototype.translateV = function (v) {
|
|
885
|
-
warning("translateV()", "translate()", "9.0.0");
|
|
886
|
-
return this.translate(v);
|
|
887
|
-
};
|
|
888
|
-
|
|
889
|
-
/**
|
|
890
|
-
* The bounds that contains all its children
|
|
891
|
-
* @public
|
|
892
|
-
* @type {me.Bounds}
|
|
893
|
-
* @name childBounds
|
|
894
|
-
* @memberOf me.Container
|
|
895
|
-
* @deprecated since 9.0.0
|
|
896
|
-
* @see me.Container.getBounds
|
|
897
|
-
*/
|
|
898
|
-
Object.defineProperty(me.Container.prototype, "childBounds", {
|
|
899
|
-
/**
|
|
900
|
-
* @ignore
|
|
901
|
-
*/
|
|
902
|
-
get : function () {
|
|
903
|
-
warning("childBounds", "getBounds()", "9.0.0");
|
|
904
|
-
return this.getBounds();
|
|
905
|
-
},
|
|
906
|
-
configurable : false
|
|
907
|
-
});
|
|
908
|
-
|
|
909
|
-
/**
|
|
910
|
-
* @class me.CollectableEntity
|
|
911
|
-
* @deprecated since 9.0.0
|
|
912
|
-
* @see me.Collectable
|
|
913
|
-
*/
|
|
914
|
-
me.CollectableEntity = me.Collectable.extend({
|
|
915
|
-
/** @ignore */
|
|
916
|
-
init: function (x, y, settings) {
|
|
917
|
-
// super constructor
|
|
918
|
-
this._super(me.Collectable, "init", [x, y, settings]);
|
|
919
|
-
// deprecation warning
|
|
920
|
-
warning("me.CollectableEntity", "me.Collectable", "9.0.0");
|
|
921
|
-
}
|
|
922
|
-
});
|
|
923
|
-
|
|
924
|
-
/**
|
|
925
|
-
* @class me.LevelEntity
|
|
926
|
-
* @deprecated since 9.0.0
|
|
927
|
-
* @see me.Trigger
|
|
928
|
-
*/
|
|
929
|
-
me.LevelEntity = me.Trigger.extend({
|
|
930
|
-
/** @ignore */
|
|
931
|
-
init: function (x, y, settings) {
|
|
932
|
-
// super constructor
|
|
933
|
-
this._super(me.Trigger, "init", [x, y, settings]);
|
|
934
|
-
// deprecation warning
|
|
935
|
-
warning("me.LevelEntity", "me.Trigger", "9.0.0");
|
|
936
|
-
}
|
|
937
|
-
});
|
|
938
|
-
|
|
939
|
-
// corresponding entry in the object pool
|
|
940
|
-
me.pool.register("me.CollectableEntity", me.CollectableEntity);
|
|
941
|
-
me.pool.register("me.LevelEntity", me.LevelEntity);
|
|
942
|
-
|
|
943
|
-
};
|
|
57
|
+
;
|
|
58
|
+
};
|