@vpmedia/phaser 1.0.2 → 1.0.4

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 (44) hide show
  1. package/README.md +20 -3
  2. package/dist/phaser.cjs +1 -1
  3. package/dist/phaser.cjs.LICENSE.txt +1 -1
  4. package/dist/phaser.cjs.map +1 -1
  5. package/dist/phaser.js +1 -1
  6. package/dist/phaser.js.LICENSE.txt +1 -1
  7. package/dist/phaser.js.map +1 -1
  8. package/package.json +27 -20
  9. package/src/index.js +58 -15
  10. package/src/phaser/core/animation_parser.js +14 -11
  11. package/src/phaser/core/array_set.js +0 -1
  12. package/src/phaser/core/const.js +2 -2
  13. package/src/phaser/core/device_util.js +21 -19
  14. package/src/phaser/core/frame_util.js +6 -4
  15. package/src/phaser/core/game.js +8 -0
  16. package/src/phaser/core/loader.js +125 -14
  17. package/src/phaser/core/loader_parser.js +18 -14
  18. package/src/phaser/core/scene.js +0 -1
  19. package/src/phaser/core/scene_manager.js +0 -1
  20. package/src/phaser/core/sound_manager.js +2 -3
  21. package/src/phaser/core/tween_easing.js +62 -37
  22. package/src/phaser/display/canvas/graphics.js +5 -5
  23. package/src/phaser/display/canvas/masker.js +3 -3
  24. package/src/phaser/display/canvas/pool.js +10 -5
  25. package/src/phaser/display/canvas/tinter.js +12 -9
  26. package/src/phaser/display/canvas/util.js +33 -25
  27. package/src/phaser/display/graphics_data_util.js +2 -1
  28. package/src/phaser/display/sprite_util.js +14 -12
  29. package/src/phaser/display/webgl/earcut.js +106 -91
  30. package/src/phaser/display/webgl/graphics.js +31 -25
  31. package/src/phaser/display/webgl/mask_manager.js +4 -4
  32. package/src/phaser/display/webgl/texture_util.js +6 -4
  33. package/src/phaser/display/webgl/util.js +14 -10
  34. package/src/phaser/geom/polygon.js +0 -1
  35. package/src/phaser/geom/util/circle.js +26 -19
  36. package/src/phaser/geom/util/ellipse.js +7 -3
  37. package/src/phaser/geom/util/line.js +21 -16
  38. package/src/phaser/geom/util/matrix.js +7 -2
  39. package/src/phaser/geom/util/point.js +76 -56
  40. package/src/phaser/geom/util/polygon.js +6 -2
  41. package/src/phaser/geom/util/rectangle.js +59 -42
  42. package/src/phaser/geom/util/rounded_rectangle.js +6 -2
  43. package/src/phaser/util/math.js +61 -43
  44. package/src/phaser/util/string.js +6 -0
package/package.json CHANGED
@@ -1,46 +1,53 @@
1
1
  {
2
2
  "name": "@vpmedia/phaser",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
+ "description": "@vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2",
4
5
  "author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
5
6
  "license": "MIT",
6
- "homepage": "https://github.com/vpmedia/phaser",
7
- "private": false,
7
+ "homepage": "https://github.com/vpmedia/phaser#readme",
8
+ "bugs": {
9
+ "url": "https://github.com/vpmedia/phaser/issues"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/vpmedia/phaser.git"
14
+ },
15
+ "keywords": [
16
+ "phaser"
17
+ ],
8
18
  "main": "./src/index.js",
9
19
  "devDependencies": {
10
20
  "@babel/cli": "^7.19.3",
11
- "@babel/core": "^7.19.6",
21
+ "@babel/core": "^7.20.2",
12
22
  "@babel/eslint-parser": "^7.19.1",
13
- "@babel/preset-env": "^7.19.4",
23
+ "@babel/preset-env": "^7.20.2",
14
24
  "@babel/register": "^7.18.9",
15
- "babel-loader": "^8.2.5",
16
- "chai": "^4.3.6",
17
- "eslint": "^8.26.0",
25
+ "babel-loader": "^8.3.0",
26
+ "eslint": "^8.28.0",
18
27
  "eslint-config-prettier": "^8.5.0",
19
28
  "eslint-plugin-import": "^2.26.0",
20
- "eslint-plugin-jsdoc": "^39.5.0",
29
+ "eslint-plugin-jest": "^27.1.5",
30
+ "eslint-plugin-jsdoc": "^39.6.2",
21
31
  "eslint-plugin-prettier": "^4.2.1",
22
- "husky": "^8.0.1",
32
+ "husky": "^8.0.2",
33
+ "jest": "^29.3.1",
23
34
  "lint-staged": "^13.0.3",
24
- "mocha": "^10.1.0",
25
- "mocha-junit-reporter": "^2.1.1",
26
35
  "prettier": "^2.7.1",
27
- "sinon": "^14.0.1",
28
- "sinon-chai": "^3.7.0",
29
- "webpack": "^5.74.0",
36
+ "webpack": "^5.75.0",
30
37
  "webpack-cli": "^4.10.0"
31
38
  },
32
39
  "scripts": {
33
40
  "prebuild": "rm -rf ./dist && mkdir -p ./dist",
34
41
  "build": "webpack --config webpack.config.babel.js --mode production",
35
- "test": "mocha \"test/**/*test.js\" --require test/setup.js --require @babel/register --colors",
36
- "lint": "eslint src/**/*.js && eslint test/**/*.js",
37
- "lint-fix": "eslint src/**/*.js --fix && eslint test/**/*.js --fix",
42
+ "test": "jest --passWithNoTests",
43
+ "lint": "eslint \"**/*.js\"",
44
+ "lint-fix": "eslint \"**/*.js\" --fix",
38
45
  "format": "prettier --write \"**/*.{js,json}\"",
39
46
  "lint-staged": "lint-staged",
40
47
  "prepack": "npm run build"
41
48
  },
42
49
  "engines": {
43
- "npm": ">=8.0.0",
44
- "node": ">=18.0.0"
50
+ "npm": ">=7.0.0",
51
+ "node": ">=16.0.0"
45
52
  }
46
53
  }
package/src/index.js CHANGED
@@ -73,27 +73,70 @@ import Text from './phaser/display/text';
73
73
 
74
74
  export {
75
75
  Const,
76
- AnimationManager, AnimationParser,
76
+ AnimationManager,
77
+ AnimationParser,
77
78
  ArraySet,
78
79
  DOM,
79
- Device, DeviceUtils,
80
+ Device,
81
+ DeviceUtils,
80
82
  EventManager,
81
- Frame, FrameData,
82
- InputManager, InputMouse, InputMSPointer, InputPointer, InputTouch,
83
+ Frame,
84
+ FrameData,
85
+ InputManager,
86
+ InputMouse,
87
+ InputMSPointer,
88
+ InputPointer,
89
+ InputTouch,
83
90
  Loader,
84
- GameLoopRAF, GameLoopTO, GameLoopFB,
85
- MathUtils, StringUtils,
91
+ GameLoopRAF,
92
+ GameLoopTO,
93
+ GameLoopFB,
94
+ MathUtils,
95
+ StringUtils,
86
96
  ScaleManager,
87
- Scene, SceneManager,
88
- Signal, SignalBinding,
89
- Sound, SoundManager,
90
- Time, Timer, TimerEvent,
91
- Tween, TweenData, TweenEasing, TweenManager,
92
- Circle, CircleUtils, Ellipse, EllipseUtils, Line, LineUtils, Matrix, MatrixUtils, Point, PointUtils,
93
- Polygon, PolygonUtils, Rectangle, RectangleUtils, RoundedRectangle, RoundedRectangleUtils,
97
+ Scene,
98
+ SceneManager,
99
+ Signal,
100
+ SignalBinding,
101
+ Sound,
102
+ SoundManager,
103
+ Time,
104
+ Timer,
105
+ TimerEvent,
106
+ Tween,
107
+ TweenData,
108
+ TweenEasing,
109
+ TweenManager,
110
+ Circle,
111
+ CircleUtils,
112
+ Ellipse,
113
+ EllipseUtils,
114
+ Line,
115
+ LineUtils,
116
+ Matrix,
117
+ MatrixUtils,
118
+ Point,
119
+ PointUtils,
120
+ Polygon,
121
+ PolygonUtils,
122
+ Rectangle,
123
+ RectangleUtils,
124
+ RoundedRectangle,
125
+ RoundedRectangleUtils,
94
126
  Game,
95
127
  GraphicsData,
96
- CanvasPool, CanvasUtils, CanvasBuffer, CanvasTinter, CanvasMasker, CanvasGraphics, CanvasRenderer,
128
+ CanvasPool,
129
+ CanvasUtils,
130
+ CanvasBuffer,
131
+ CanvasTinter,
132
+ CanvasMasker,
133
+ CanvasGraphics,
134
+ CanvasRenderer,
97
135
  EarCut,
98
- BitmapText, Button, DisplayObject, Image, Group, Text,
136
+ BitmapText,
137
+ Button,
138
+ DisplayObject,
139
+ Image,
140
+ Group,
141
+ Text,
99
142
  };
@@ -8,13 +8,14 @@ import FrameData from './frame_data';
8
8
 
9
9
  /**
10
10
  *
11
- * @param game
12
- * @param key
13
- * @param frameWidth
14
- * @param frameHeight
15
- * @param frameMax
16
- * @param margin
17
- * @param spacing
11
+ * @param {object} game TBD
12
+ * @param {object} key TBD
13
+ * @param {number} frameWidth TBD
14
+ * @param {number} frameHeight TBD
15
+ * @param {number} frameMax TBD
16
+ * @param {number} margin TBD
17
+ * @param {number} spacing TBD
18
+ * @returns {object} TBD
18
19
  */
19
20
  export function spriteSheet(game, key, frameWidth, frameHeight, frameMax, margin, spacing) {
20
21
  let img = key;
@@ -60,8 +61,9 @@ export function spriteSheet(game, key, frameWidth, frameHeight, frameMax, margin
60
61
 
61
62
  /**
62
63
  *
63
- * @param game
64
- * @param json
64
+ * @param {object} game TBD
65
+ * @param {object} json TBD
66
+ * @returns {object} TBD
65
67
  */
66
68
  export function JSONData(game, json) {
67
69
  // Malformed?
@@ -95,8 +97,9 @@ export function JSONDataPyxel() {
95
97
 
96
98
  /**
97
99
  *
98
- * @param game
99
- * @param json
100
+ * @param {object} game TBD
101
+ * @param {object} json TBD
102
+ * @returns {object} TBD
100
103
  */
101
104
  export function JSONDataHash(game, json) {
102
105
  if (!json.frames) {
@@ -3,7 +3,6 @@
3
3
  * @author Richard Davey <rich@photonstorm.com>
4
4
  * @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
5
5
  */
6
- /* eslint-disable prefer-spread */
7
6
  export default class {
8
7
 
9
8
  constructor(list = []) {
@@ -101,6 +101,6 @@ export const PENDING_ATLAS = -1;
101
101
  export const TEXTURE_ATLAS_JSON_ARRAY = 0;
102
102
  export const TEXTURE_ATLAS_JSON_HASH = 1;
103
103
  export const TEXTURE_ATLAS_XML_STARLING = 2;
104
- export const PHYSICS_LIME_CORONA_JSON = 3;
105
- export const PHYSICS_PHASER_JSON = 4;
104
+ export const PHYSICS_LIME_CORONA_JSON = 3; // deprecated
105
+ export const PHYSICS_PHASER_JSON = 4; // deprecated
106
106
  export const TEXTURE_ATLAS_JSON_PYXEL = 5;
@@ -6,8 +6,9 @@
6
6
 
7
7
  /**
8
8
  *
9
- * @param device
10
- * @param type
9
+ * @param {object} device TBD
10
+ * @param {string} type TBD
11
+ * @returns {boolean} TBD
11
12
  */
12
13
  export function canPlayAudio(device, type) {
13
14
  if (type === 'mp3' && device.mp3) {
@@ -30,8 +31,9 @@ export function canPlayAudio(device, type) {
30
31
 
31
32
  /**
32
33
  *
33
- * @param device
34
- * @param type
34
+ * @param {object} device TBD
35
+ * @param {string} type TBD
36
+ * @returns {boolean} TBD
35
37
  */
36
38
  export function canPlayVideo(device, type) {
37
39
  if (type === 'webm' && (device.webmVideo || device.vp9Video)) {
@@ -48,7 +50,7 @@ export function canPlayVideo(device, type) {
48
50
 
49
51
  /**
50
52
  *
51
- * @param device
53
+ * @param {object} device TBD
52
54
  */
53
55
  export function checkOS(device) {
54
56
  const ua = navigator.userAgent;
@@ -90,7 +92,7 @@ export function checkOS(device) {
90
92
 
91
93
  /**
92
94
  *
93
- * @param device
95
+ * @param {object} device TBD
94
96
  */
95
97
  export function checkFeatures(device) {
96
98
  device.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document;
@@ -98,7 +100,7 @@ export function checkFeatures(device) {
98
100
 
99
101
  /**
100
102
  *
101
- * @param device
103
+ * @param {object} device TBD
102
104
  */
103
105
  export function checkInput(device) {
104
106
  if ('ontouchstart' in document.documentElement || (window.navigator.maxTouchPoints && window.navigator.maxTouchPoints >= 1)) {
@@ -124,7 +126,7 @@ export function checkInput(device) {
124
126
 
125
127
  /**
126
128
  *
127
- * @param device
129
+ * @param {object} device TBD
128
130
  */
129
131
  export function checkFullScreenSupport(device) {
130
132
  const fs = [
@@ -170,7 +172,7 @@ export function checkFullScreenSupport(device) {
170
172
 
171
173
  /**
172
174
  *
173
- * @param device
175
+ * @param {object} device TBD
174
176
  */
175
177
  export function checkBrowser(device) {
176
178
  const ua = navigator.userAgent;
@@ -218,7 +220,7 @@ export function checkBrowser(device) {
218
220
  if (device.cocoonJS) {
219
221
  try {
220
222
  device.cocoonJSApp = (typeof CocoonJS !== 'undefined');
221
- } catch (error) {
223
+ } catch (e) {
222
224
  device.cocoonJSApp = false;
223
225
  }
224
226
  }
@@ -226,7 +228,7 @@ export function checkBrowser(device) {
226
228
 
227
229
  /**
228
230
  *
229
- * @param device
231
+ * @param {object} device TBD
230
232
  */
231
233
  export function checkVideo(device) {
232
234
  const videoElement = document.createElement('video');
@@ -257,7 +259,7 @@ export function checkVideo(device) {
257
259
 
258
260
  /**
259
261
  *
260
- * @param device
262
+ * @param {object} device TBD
261
263
  */
262
264
  export function checkAudio(device) {
263
265
  device.audioData = !!(window.Audio);
@@ -307,7 +309,7 @@ export function checkAudio(device) {
307
309
 
308
310
  /**
309
311
  *
310
- * @param device
312
+ * @param {object} device TBD
311
313
  */
312
314
  export function checkDevice(device) {
313
315
  device.pixelRatio = window.devicePixelRatio || 1;
@@ -317,7 +319,7 @@ export function checkDevice(device) {
317
319
 
318
320
  /**
319
321
  *
320
- * @param device
322
+ * @param {object} device TBD
321
323
  */
322
324
  export function initialize(device) {
323
325
  checkOS(device);
@@ -331,7 +333,7 @@ export function initialize(device) {
331
333
  }
332
334
 
333
335
  /**
334
- *
336
+ * TBD
335
337
  */
336
338
  export function readyCheck() {
337
339
  if (!document.body) {
@@ -354,10 +356,10 @@ export function readyCheck() {
354
356
 
355
357
  /**
356
358
  *
357
- * @param device
358
- * @param callback
359
- * @param context
360
- * @param nonPrimer
359
+ * @param {object} device TBD
360
+ * @param {Function} callback TBD
361
+ * @param {object} context TBD
362
+ * @param {boolean} nonPrimer TBD
361
363
  */
362
364
  export function whenReady(device, callback, context, nonPrimer) {
363
365
  if (device.deviceReadyAt) {
@@ -8,8 +8,9 @@ import FrameData from './frame_data';
8
8
 
9
9
  /**
10
10
  *
11
- * @param frame
12
- * @param output
11
+ * @param {object} frame TBD
12
+ * @param {object} output TBD
13
+ * @returns {object} TBD
13
14
  */
14
15
  export function cloneFrame(frame, output = null) {
15
16
  const result = output || new Frame();
@@ -19,8 +20,9 @@ export function cloneFrame(frame, output = null) {
19
20
 
20
21
  /**
21
22
  *
22
- * @param frameData
23
- * @param output
23
+ * @param {object} frameData TBD
24
+ * @param {object} output TBD
25
+ * @returns {object} TBD
24
26
  */
25
27
  export function cloneFrameData(frameData, output = null) {
26
28
  const result = output || new FrameData();
@@ -143,6 +143,7 @@ export default class {
143
143
  isWebGlReady = true;
144
144
  } catch (e) {
145
145
  isWebGlReady = false;
146
+ this.exceptionHandler(e);
146
147
  }
147
148
  /*
148
149
  this.renderer = new WebGLRenderer(this);
@@ -216,6 +217,13 @@ export default class {
216
217
  if (config.renderer) {
217
218
  this.config.renderType = config.renderer;
218
219
  }
220
+ if (config.exceptionHandler) {
221
+ this.exceptionHandler = config.exceptionHandler;
222
+ } else {
223
+ this.exceptionHandler = (e) => {
224
+ console.error(e);
225
+ };
226
+ }
219
227
  if (config.parent) {
220
228
  this.parent = config.parent;
221
229
  }
@@ -179,18 +179,52 @@ export default class {
179
179
  return this.addToFileList(type, key, url, properties, true);
180
180
  }
181
181
 
182
- pack() {
183
- // TODO
184
- console.warn('loader.pack() is not implemented');
182
+ pack(key, url, data, callbackContext) {
183
+ const pack = {
184
+ type: 'packfile',
185
+ key: key,
186
+ url: url,
187
+ path: this.path,
188
+ syncPoint: true,
189
+ data: null,
190
+ loading: false,
191
+ loaded: false,
192
+ error: false,
193
+ callbackContext: callbackContext
194
+ };
195
+ if (data) {
196
+ if (typeof data === 'string') {
197
+ data = JSON.parse(data);
198
+ }
199
+ pack.data = data || {};
200
+ pack.loaded = true;
201
+ }
202
+ for (let i = 0; i < this._fileList.length + 1; i += 1) {
203
+ const file = this._fileList[i];
204
+ if (!file || (!file.loaded && !file.loading && file.type !== 'packfile')) {
205
+ this._fileList.splice(i, 0, pack);
206
+ this._totalPackCount += 1;
207
+ break;
208
+ }
209
+ }
210
+ return this;
185
211
  }
186
212
 
187
213
  image(key, url, overwrite) {
188
214
  return this.addToFileList('image', key, url, undefined, overwrite, '.png');
189
215
  }
190
216
 
191
- images() {
192
- // TODO
193
- console.warn('loader.images() is not implemented');
217
+ images(keys, urls) {
218
+ if (Array.isArray(urls)) {
219
+ for (let i = 0; i < keys.length; i += 1) {
220
+ this.image(keys[i], urls[i]);
221
+ }
222
+ } else {
223
+ for (let i = 0; i < keys.length; i += 1) {
224
+ this.image(keys[i]);
225
+ }
226
+ }
227
+ return this;
194
228
  }
195
229
 
196
230
  text(key, url, overwrite) {
@@ -231,19 +265,32 @@ export default class {
231
265
  return this.addToFileList('audio', key, urls, { buffer: null, autoDecode });
232
266
  }
233
267
 
234
- audioSprite() {
235
- // TODO
236
- console.warn('loader.audioSprite() is not implemented');
268
+ audioSprite(key, urls, jsonURL, jsonData, autoDecode = true) {
269
+ if (this.game.sound.noAudio) {
270
+ return this;
271
+ }
272
+ this.audio(key, urls, autoDecode);
273
+ if (jsonURL) {
274
+ this.json(key + '-audioatlas', jsonURL);
275
+ } else if (jsonData) {
276
+ if (typeof jsonData === 'string') {
277
+ jsonData = JSON.parse(jsonData);
278
+ }
279
+ this.cache.addJSON(key + '-audioatlas', '', jsonData);
280
+ }
281
+ return this;
237
282
  }
238
283
 
239
284
  video() {
240
285
  // TODO
241
286
  console.warn('loader.video() is not implemented');
287
+ return this;
242
288
  }
243
289
 
244
290
  tilemap() {
245
291
  // TODO
246
292
  console.warn('loader.tilemap() is not implemented');
293
+ return this;
247
294
  }
248
295
 
249
296
  bitmapFont(key, textureURL = null, atlasURL = null, atlasData = null, xSpacing = 0, ySpacing = 0) {
@@ -487,9 +534,73 @@ export default class {
487
534
  this.processLoadQueue();
488
535
  }
489
536
 
490
- processPack() {
491
- // TODO
492
- console.warn('loader.processPack() is not implemented');
537
+ processPack(pack) {
538
+ const packData = pack.data[pack.key];
539
+ if (!packData) {
540
+ console.warn('Missing loader pack key', pack.key);
541
+ return;
542
+ }
543
+ for (let i = 0; i < packData.length; i += 1) {
544
+ const file = packData[i];
545
+ switch (file.type) {
546
+ case "image":
547
+ this.image(file.key, file.url, file.overwrite);
548
+ break;
549
+ case "text":
550
+ this.text(file.key, file.url, file.overwrite);
551
+ break;
552
+ case "json":
553
+ this.json(file.key, file.url, file.overwrite);
554
+ break;
555
+ case "xml":
556
+ this.xml(file.key, file.url, file.overwrite);
557
+ break;
558
+ case "script":
559
+ this.script(file.key, file.url, file.callback, pack.callbackContext || this);
560
+ break;
561
+ case "binary":
562
+ this.binary(file.key, file.url, file.callback, pack.callbackContext || this);
563
+ break;
564
+ case "spritesheet":
565
+ this.spritesheet(file.key, file.url, file.frameWidth, file.frameHeight, file.frameMax, file.margin, file.spacing);
566
+ break;
567
+ case "video":
568
+ this.video(file.key, file.urls);
569
+ break;
570
+ case "audio":
571
+ this.audio(file.key, file.urls, file.autoDecode);
572
+ break;
573
+ case "audiosprite":
574
+ this.audioSprite(file.key, file.urls, file.jsonURL, file.jsonData, file.autoDecode);
575
+ break;
576
+ case "tilemap":
577
+ // TODO
578
+ // this.tilemap(file.key, file.url, file.data, Phaser.Tilemap[file.format]);
579
+ break;
580
+ case "physics":
581
+ // TODO
582
+ // this.physics(file.key, file.url, file.data, Phaser.Loader[file.format]);
583
+ break;
584
+ case "bitmapFont":
585
+ this.bitmapFont(file.key, file.textureURL, file.atlasURL, file.atlasData, file.xSpacing, file.ySpacing);
586
+ break;
587
+ case "atlasJSONArray":
588
+ this.atlasJSONArray(file.key, file.textureURL, file.atlasURL, file.atlasData);
589
+ break;
590
+ case "atlasJSONHash":
591
+ this.atlasJSONHash(file.key, file.textureURL, file.atlasURL, file.atlasData);
592
+ break;
593
+ case "atlasXML":
594
+ this.atlasXML(file.key, file.textureURL, file.atlasURL, file.atlasData);
595
+ break;
596
+ case "atlas":
597
+ this.atlas(file.key, file.textureURL, file.atlasURL, file.atlasData, file.format === 'TEXTURE_ATLAS_JSON_HASH' ? TEXTURE_ATLAS_JSON_HASH : TEXTURE_ATLAS_JSON_ARRAY);
598
+ break;
599
+ case "shader":
600
+ this.shader(file.key, file.url, file.overwrite);
601
+ break;
602
+ }
603
+ }
493
604
  }
494
605
 
495
606
  transformUrl(url, file) {
@@ -658,7 +769,7 @@ export default class {
658
769
  if (!scope.hasLoaded) {
659
770
  scope.asyncComplete(file, e.message || 'Exception');
660
771
  } else {
661
- console.error(e);
772
+ scope.game.exceptionHandler(e);
662
773
  }
663
774
  }
664
775
  return null;
@@ -670,7 +781,7 @@ export default class {
670
781
  if (!scope.hasLoaded) {
671
782
  scope.asyncComplete(file, e.message || 'Exception');
672
783
  } else {
673
- console.error(e);
784
+ scope.game.exceptionHandler(e);
674
785
  }
675
786
  }
676
787
  return null;
@@ -8,8 +8,9 @@ import Rectangle from '../geom/rectangle';
8
8
 
9
9
  /**
10
10
  *
11
- * @param baseTexture
12
- * @param bitmapFontData
11
+ * @param {object} baseTexture TBD
12
+ * @param {object} bitmapFontData TBD
13
+ * @returns {object} TBD
13
14
  */
14
15
  export function finalizeBitmapFont(baseTexture, bitmapFontData) {
15
16
  Object.keys(bitmapFontData.chars).forEach((charCode) => {
@@ -21,10 +22,11 @@ export function finalizeBitmapFont(baseTexture, bitmapFontData) {
21
22
 
22
23
  /**
23
24
  *
24
- * @param xml
25
- * @param baseTexture
26
- * @param xSpacing
27
- * @param ySpacing
25
+ * @param {object} xml TBD
26
+ * @param {object} baseTexture TBD
27
+ * @param {number} xSpacing TBD
28
+ * @param {number} ySpacing TBD
29
+ * @returns {object} TBD
28
30
  */
29
31
  export function xmlBitmapFont(xml, baseTexture, xSpacing, ySpacing) {
30
32
  const data = {};
@@ -60,10 +62,11 @@ export function xmlBitmapFont(xml, baseTexture, xSpacing, ySpacing) {
60
62
 
61
63
  /**
62
64
  *
63
- * @param xml
64
- * @param baseTexture
65
- * @param xSpacing
66
- * @param ySpacing
65
+ * @param {object} xml TBD
66
+ * @param {object} baseTexture TBD
67
+ * @param {number} xSpacing TBD
68
+ * @param {number} ySpacing TBD
69
+ * @returns {object} TBD
67
70
  */
68
71
  export function bitmapFont(xml, baseTexture, xSpacing, ySpacing) {
69
72
  return xmlBitmapFont(xml, baseTexture, xSpacing, ySpacing);
@@ -71,10 +74,11 @@ export function bitmapFont(xml, baseTexture, xSpacing, ySpacing) {
71
74
 
72
75
  /**
73
76
  *
74
- * @param json
75
- * @param baseTexture
76
- * @param xSpacing
77
- * @param ySpacing
77
+ * @param {object} json TBD
78
+ * @param {object} baseTexture TBD
79
+ * @param {number} xSpacing TBD
80
+ * @param {number} ySpacing TBD
81
+ * @returns {object} TBD
78
82
  */
79
83
  export function jsonBitmapFont(json, baseTexture, xSpacing, ySpacing) {
80
84
  const data = {
@@ -3,7 +3,6 @@
3
3
  * @author Richard Davey <rich@photonstorm.com>
4
4
  * @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
5
5
  */
6
- /* eslint-disable class-methods-use-this */
7
6
  export default class {
8
7
 
9
8
  constructor() {
@@ -3,7 +3,6 @@
3
3
  * @author Richard Davey <rich@photonstorm.com>
4
4
  * @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
5
5
  */
6
- /* eslint-disable new-cap */
7
6
  import Scene from './scene';
8
7
  import { RENDER_CANVAS } from './const';
9
8