melonjs 13.2.1 → 13.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 CHANGED
@@ -91,10 +91,9 @@ Tools integration and usage with melonJS is documented in our [Wiki](https://git
91
91
 
92
92
  # Using melonJS
93
93
 
94
- ### For your first time using melonJS, use either of these tutorials for setting up the engine. These are where you start.
94
+ ### For your first time using melonJS, this is where you start
95
95
 
96
- - [Platformer](http://melonjs.github.io/tutorial-platformer/) Step by Step Tutorial.
97
- - [Space Invaders](http://melonjs.github.io/tutorial-space-invaders/) Step by Step Tutorial.
96
+ - [melonJS: Hacking a Platformer Game](https://melonjs.org/tutorial/)
98
97
 
99
98
  You may find it useful to skim the overview found at the wiki [Details & Usage](https://github.com/melonjs/melonJS/wiki#details--usage)
100
99
 
@@ -112,7 +111,7 @@ A few demos of melonJS capabilities :
112
111
  * [Primitive Drawing Demo](https://melonjs.github.io/examples/graphics/)
113
112
  * [UI Demo](https://melonjs.github.io/examples/UI/)
114
113
 
115
- More examples are available [here](https://melonjs.github.io/examples/)
114
+ More examples are available [here](https://melonjs.github.io/examples/)
116
115
 
117
116
  -------------------------------------------------------------------------------
118
117
 
@@ -148,8 +147,9 @@ Documentation
148
147
  -------------------------------------------------------------------------------
149
148
 
150
149
  * [Online API](http://melonjs.github.io/melonJS/docs/)
151
- * [offline](https://github.com/melonjs/melonJS/archive/gh-pages.zip) version under the `docs` directory)
152
150
 
151
+ To enable an offline version of the documentation, navigate to the settings page and enable `offline storage`:
152
+ <img width="297" alt="186643536-854af31e-9c94-412e-a764-4bb7f93f15c3" src="https://user-images.githubusercontent.com/4033090/187061867-cf8c4c8a-437b-4f76-9138-610adda0ca23.png">
153
153
 
154
154
  Download melonJS
155
155
  -------------------------------------------------------------------------------
package/dist/melonjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v13.2.1
2
+ * melonJS Game Engine - v13.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
@@ -19,7 +19,7 @@
19
19
 
20
20
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
21
21
  var global$c =
22
- // eslint-disable-next-line es-x/no-global-this -- safe
22
+ // eslint-disable-next-line es/no-global-this -- safe
23
23
  check(typeof globalThis == 'object' && globalThis) ||
24
24
  check(typeof window == 'object' && window) ||
25
25
  // eslint-disable-next-line no-restricted-globals -- safe
@@ -42,14 +42,14 @@
42
42
 
43
43
  // Detect IE8's incomplete defineProperty implementation
44
44
  var descriptors = !fails$8(function () {
45
- // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
45
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
46
46
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
47
47
  });
48
48
 
49
49
  var fails$7 = fails$9;
50
50
 
51
51
  var functionBindNative = !fails$7(function () {
52
- // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
52
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
53
53
  var test = (function () { /* empty */ }).bind();
54
54
  // eslint-disable-next-line no-prototype-builtins -- safe
55
55
  return typeof test != 'function' || test.hasOwnProperty('prototype');
@@ -66,7 +66,7 @@
66
66
  var objectPropertyIsEnumerable = {};
67
67
 
68
68
  var $propertyIsEnumerable = {}.propertyIsEnumerable;
69
- // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
69
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
70
70
  var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
71
71
 
72
72
  // Nashorn ~ JDK8 bug
@@ -128,12 +128,20 @@
128
128
  return classof$2(it) == 'String' ? split(it, '') : $Object$3(it);
129
129
  } : $Object$3;
130
130
 
131
+ // we can't use just `it == null` since of `document.all` special case
132
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
133
+ var isNullOrUndefined$2 = function (it) {
134
+ return it === null || it === undefined;
135
+ };
136
+
137
+ var isNullOrUndefined$1 = isNullOrUndefined$2;
138
+
131
139
  var $TypeError$5 = TypeError;
132
140
 
133
141
  // `RequireObjectCoercible` abstract operation
134
142
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
135
143
  var requireObjectCoercible$3 = function (it) {
136
- if (it == undefined) { throw $TypeError$5("Can't call method on " + it); }
144
+ if (isNullOrUndefined$1(it)) { throw $TypeError$5("Can't call method on " + it); }
137
145
  return it;
138
146
  };
139
147
 
@@ -145,15 +153,36 @@
145
153
  return IndexedObject(requireObjectCoercible$2(it));
146
154
  };
147
155
 
156
+ var documentAll$2 = typeof document == 'object' && document.all;
157
+
158
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
159
+ var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
160
+
161
+ var documentAll_1 = {
162
+ all: documentAll$2,
163
+ IS_HTMLDDA: IS_HTMLDDA
164
+ };
165
+
166
+ var $documentAll$1 = documentAll_1;
167
+
168
+ var documentAll$1 = $documentAll$1.all;
169
+
148
170
  // `IsCallable` abstract operation
149
171
  // https://tc39.es/ecma262/#sec-iscallable
150
- var isCallable$b = function (argument) {
172
+ var isCallable$b = $documentAll$1.IS_HTMLDDA ? function (argument) {
173
+ return typeof argument == 'function' || argument === documentAll$1;
174
+ } : function (argument) {
151
175
  return typeof argument == 'function';
152
176
  };
153
177
 
154
178
  var isCallable$a = isCallable$b;
179
+ var $documentAll = documentAll_1;
180
+
181
+ var documentAll = $documentAll.all;
155
182
 
156
- var isObject$5 = function (it) {
183
+ var isObject$5 = $documentAll.IS_HTMLDDA ? function (it) {
184
+ return typeof it == 'object' ? it !== null : isCallable$a(it) || it === documentAll;
185
+ } : function (it) {
157
186
  return typeof it == 'object' ? it !== null : isCallable$a(it);
158
187
  };
159
188
 
@@ -204,13 +233,13 @@
204
233
 
205
234
  var engineV8Version = version$1;
206
235
 
207
- /* eslint-disable es-x/no-symbol -- required for testing */
236
+ /* eslint-disable es/no-symbol -- required for testing */
208
237
 
209
238
  var V8_VERSION = engineV8Version;
210
239
  var fails$5 = fails$9;
211
240
 
212
- // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
213
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$5(function () {
241
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
242
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5(function () {
214
243
  var symbol = Symbol();
215
244
  // Chrome 38 Symbol has incorrect toString conversion
216
245
  // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
@@ -219,9 +248,9 @@
219
248
  !Symbol.sham && V8_VERSION && V8_VERSION < 41;
220
249
  });
221
250
 
222
- /* eslint-disable es-x/no-symbol -- required for testing */
251
+ /* eslint-disable es/no-symbol -- required for testing */
223
252
 
224
- var NATIVE_SYMBOL$1 = nativeSymbol;
253
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
225
254
 
226
255
  var useSymbolAsUid = NATIVE_SYMBOL$1
227
256
  && !Symbol.sham
@@ -263,12 +292,13 @@
263
292
  };
264
293
 
265
294
  var aCallable = aCallable$1;
295
+ var isNullOrUndefined = isNullOrUndefined$2;
266
296
 
267
297
  // `GetMethod` abstract operation
268
298
  // https://tc39.es/ecma262/#sec-getmethod
269
299
  var getMethod$1 = function (V, P) {
270
300
  var func = V[P];
271
- return func == null ? undefined : aCallable(func);
301
+ return isNullOrUndefined(func) ? undefined : aCallable(func);
272
302
  };
273
303
 
274
304
  var call$2 = functionCall;
@@ -291,7 +321,7 @@
291
321
 
292
322
  var global$9 = global$c;
293
323
 
294
- // eslint-disable-next-line es-x/no-object-defineproperty -- safe
324
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
295
325
  var defineProperty$1 = Object.defineProperty;
296
326
 
297
327
  var defineGlobalProperty$3 = function (key, value) {
@@ -315,10 +345,10 @@
315
345
  (shared$3.exports = function (key, value) {
316
346
  return store$2[key] || (store$2[key] = value !== undefined ? value : {});
317
347
  })('versions', []).push({
318
- version: '3.24.1',
348
+ version: '3.25.3',
319
349
  mode: 'global',
320
350
  copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
321
- license: 'https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE',
351
+ license: 'https://github.com/zloirock/core-js/blob/v3.25.3/LICENSE',
322
352
  source: 'https://github.com/zloirock/core-js'
323
353
  });
324
354
 
@@ -339,7 +369,7 @@
339
369
 
340
370
  // `HasOwnProperty` abstract operation
341
371
  // https://tc39.es/ecma262/#sec-hasownproperty
342
- // eslint-disable-next-line es-x/no-object-hasown -- safe
372
+ // eslint-disable-next-line es/no-object-hasown -- safe
343
373
  var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
344
374
  return hasOwnProperty(toObject(it), key);
345
375
  };
@@ -358,7 +388,7 @@
358
388
  var shared$2 = shared$3.exports;
359
389
  var hasOwn$6 = hasOwnProperty_1;
360
390
  var uid$1 = uid$2;
361
- var NATIVE_SYMBOL = nativeSymbol;
391
+ var NATIVE_SYMBOL = symbolConstructorDetection;
362
392
  var USE_SYMBOL_AS_UID = useSymbolAsUid;
363
393
 
364
394
  var WellKnownSymbolsStore = shared$2('wks');
@@ -432,7 +462,7 @@
432
462
 
433
463
  // Thanks to IE8 for its funny defineProperty
434
464
  var ie8DomDefine = !DESCRIPTORS$6 && !fails$4(function () {
435
- // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
465
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
436
466
  return Object.defineProperty(createElement('div'), 'a', {
437
467
  get: function () { return 7; }
438
468
  }).a != 7;
@@ -447,7 +477,7 @@
447
477
  var hasOwn$5 = hasOwnProperty_1;
448
478
  var IE8_DOM_DEFINE$1 = ie8DomDefine;
449
479
 
450
- // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
480
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
451
481
  var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
452
482
 
453
483
  // `Object.getOwnPropertyDescriptor` method
@@ -469,7 +499,7 @@
469
499
  // V8 ~ Chrome 36-
470
500
  // https://bugs.chromium.org/p/v8/issues/detail?id=3334
471
501
  var v8PrototypeDefineBug = DESCRIPTORS$4 && fails$3(function () {
472
- // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
502
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
473
503
  return Object.defineProperty(function () { /* empty */ }, 'prototype', {
474
504
  value: 42,
475
505
  writable: false
@@ -494,9 +524,9 @@
494
524
  var toPropertyKey = toPropertyKey$2;
495
525
 
496
526
  var $TypeError = TypeError;
497
- // eslint-disable-next-line es-x/no-object-defineproperty -- safe
527
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
498
528
  var $defineProperty = Object.defineProperty;
499
- // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
529
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
500
530
  var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
501
531
  var ENUMERABLE = 'enumerable';
502
532
  var CONFIGURABLE$1 = 'configurable';
@@ -548,7 +578,7 @@
548
578
  var hasOwn$4 = hasOwnProperty_1;
549
579
 
550
580
  var FunctionPrototype = Function.prototype;
551
- // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
581
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
552
582
  var getDescriptor = DESCRIPTORS$1 && Object.getOwnPropertyDescriptor;
553
583
 
554
584
  var EXISTS = hasOwn$4(FunctionPrototype, 'name');
@@ -575,15 +605,14 @@
575
605
  };
576
606
  }
577
607
 
578
- var inspectSource$2 = store$1.inspectSource;
608
+ var inspectSource$1 = store$1.inspectSource;
579
609
 
580
610
  var global$5 = global$c;
581
611
  var isCallable$4 = isCallable$b;
582
- var inspectSource$1 = inspectSource$2;
583
612
 
584
613
  var WeakMap$1 = global$5.WeakMap;
585
614
 
586
- var nativeWeakMap = isCallable$4(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
615
+ var weakMapBasicDetection = isCallable$4(WeakMap$1) && /native code/.test(String(WeakMap$1));
587
616
 
588
617
  var shared$1 = shared$3.exports;
589
618
  var uid = uid$2;
@@ -596,7 +625,7 @@
596
625
 
597
626
  var hiddenKeys$3 = {};
598
627
 
599
- var NATIVE_WEAK_MAP = nativeWeakMap;
628
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
600
629
  var global$4 = global$c;
601
630
  var uncurryThis$4 = functionUncurryThis;
602
631
  var isObject = isObject$5;
@@ -630,7 +659,7 @@
630
659
  var wmhas = uncurryThis$4(store.has);
631
660
  var wmset = uncurryThis$4(store.set);
632
661
  set = function (it, metadata) {
633
- if (wmhas(store, it)) { throw new TypeError$1(OBJECT_ALREADY_INITIALIZED); }
662
+ if (wmhas(store, it)) { throw TypeError$1(OBJECT_ALREADY_INITIALIZED); }
634
663
  metadata.facade = it;
635
664
  wmset(store, it, metadata);
636
665
  return metadata;
@@ -645,7 +674,7 @@
645
674
  var STATE = sharedKey('state');
646
675
  hiddenKeys$2[STATE] = true;
647
676
  set = function (it, metadata) {
648
- if (hasOwn$3(it, STATE)) { throw new TypeError$1(OBJECT_ALREADY_INITIALIZED); }
677
+ if (hasOwn$3(it, STATE)) { throw TypeError$1(OBJECT_ALREADY_INITIALIZED); }
649
678
  metadata.facade = it;
650
679
  createNonEnumerableProperty$1(it, STATE, metadata);
651
680
  return metadata;
@@ -671,12 +700,12 @@
671
700
  var hasOwn$2 = hasOwnProperty_1;
672
701
  var DESCRIPTORS = descriptors;
673
702
  var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
674
- var inspectSource = inspectSource$2;
703
+ var inspectSource = inspectSource$1;
675
704
  var InternalStateModule = internalState;
676
705
 
677
706
  var enforceInternalState = InternalStateModule.enforce;
678
707
  var getInternalState = InternalStateModule.get;
679
- // eslint-disable-next-line es-x/no-object-defineproperty -- safe
708
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
680
709
  var defineProperty = Object.defineProperty;
681
710
 
682
711
  var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails$2(function () {
@@ -751,7 +780,7 @@
751
780
 
752
781
  // `Math.trunc` method
753
782
  // https://tc39.es/ecma262/#sec-math.trunc
754
- // eslint-disable-next-line es-x/no-math-trunc -- safe
783
+ // eslint-disable-next-line es/no-math-trunc -- safe
755
784
  var mathTrunc = Math.trunc || function trunc(x) {
756
785
  var n = +x;
757
786
  return (n > 0 ? floor : ceil)(n);
@@ -870,14 +899,14 @@
870
899
 
871
900
  // `Object.getOwnPropertyNames` method
872
901
  // https://tc39.es/ecma262/#sec-object.getownpropertynames
873
- // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
902
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
874
903
  objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
875
904
  return internalObjectKeys(O, hiddenKeys);
876
905
  };
877
906
 
878
907
  var objectGetOwnPropertySymbols = {};
879
908
 
880
- // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
909
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
881
910
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
882
911
 
883
912
  var getBuiltIn = getBuiltIn$3;
@@ -995,7 +1024,7 @@
995
1024
 
996
1025
  // `globalThis` object
997
1026
  // https://tc39.es/ecma262/#sec-globalthis
998
- $$4({ global: true }, {
1027
+ $$4({ global: true, forced: global$2.globalThis !== global$2 }, {
999
1028
  globalThis: global$2
1000
1029
  });
1001
1030
 
@@ -1107,7 +1136,7 @@
1107
1136
  // https://tc39.es/ecma262/#String.prototype.trimleft
1108
1137
  var stringTrimStart = forcedStringTrimMethod$1('trimStart') ? function trimStart() {
1109
1138
  return $trimStart(this);
1110
- // eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend -- safe
1139
+ // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe
1111
1140
  } : ''.trimStart;
1112
1141
 
1113
1142
  var $$3 = _export;
@@ -1115,7 +1144,7 @@
1115
1144
 
1116
1145
  // `String.prototype.trimLeft` method
1117
1146
  // https://tc39.es/ecma262/#sec-string.prototype.trimleft
1118
- // eslint-disable-next-line es-x/no-string-prototype-trimleft-trimright -- safe
1147
+ // eslint-disable-next-line es/no-string-prototype-trimleft-trimright -- safe
1119
1148
  $$3({ target: 'String', proto: true, name: 'trimStart', forced: ''.trimLeft !== trimStart$1 }, {
1120
1149
  trimLeft: trimStart$1
1121
1150
  });
@@ -1127,7 +1156,7 @@
1127
1156
 
1128
1157
  // `String.prototype.trimStart` method
1129
1158
  // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1130
- // eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend -- safe
1159
+ // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe
1131
1160
  $$2({ target: 'String', proto: true, name: 'trimStart', forced: ''.trimStart !== trimStart }, {
1132
1161
  trimStart: trimStart
1133
1162
  });
@@ -1151,7 +1180,7 @@
1151
1180
  // https://tc39.es/ecma262/#String.prototype.trimright
1152
1181
  var stringTrimEnd = forcedStringTrimMethod('trimEnd') ? function trimEnd() {
1153
1182
  return $trimEnd(this);
1154
- // eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend -- safe
1183
+ // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe
1155
1184
  } : ''.trimEnd;
1156
1185
 
1157
1186
  var $$1 = _export;
@@ -1159,7 +1188,7 @@
1159
1188
 
1160
1189
  // `String.prototype.trimRight` method
1161
1190
  // https://tc39.es/ecma262/#sec-string.prototype.trimend
1162
- // eslint-disable-next-line es-x/no-string-prototype-trimleft-trimright -- safe
1191
+ // eslint-disable-next-line es/no-string-prototype-trimleft-trimright -- safe
1163
1192
  $$1({ target: 'String', proto: true, name: 'trimEnd', forced: ''.trimRight !== trimEnd$1 }, {
1164
1193
  trimRight: trimEnd$1
1165
1194
  });
@@ -1171,7 +1200,7 @@
1171
1200
 
1172
1201
  // `String.prototype.trimEnd` method
1173
1202
  // https://tc39.es/ecma262/#sec-string.prototype.trimend
1174
- // eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend -- safe
1203
+ // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe
1175
1204
  $({ target: 'String', proto: true, name: 'trimEnd', forced: ''.trimEnd !== trimEnd }, {
1176
1205
  trimEnd: trimEnd
1177
1206
  });
@@ -32989,10 +33018,10 @@
32989
33018
  * this can be overridden by the plugin
32990
33019
  * @public
32991
33020
  * @type {string}
32992
- * @default "13.2.1"
33021
+ * @default "13.4.0"
32993
33022
  * @name plugin.Base#version
32994
33023
  */
32995
- this.version = "13.2.1";
33024
+ this.version = "13.4.0";
32996
33025
  };
32997
33026
 
32998
33027
  /**
@@ -34187,9 +34216,11 @@
34187
34216
  for (var i = 0; i < characters.length; i++) {
34188
34217
  var ch = characters[i].charCodeAt(0);
34189
34218
  var glyph = this.ancestor.fontData.glyphs[ch];
34190
- var kerning = (lastGlyph && lastGlyph.kerning) ? lastGlyph.getKerning(ch) : 0;
34191
- width += (glyph.xadvance + kerning) * this.ancestor.fontScale.x;
34192
- lastGlyph = glyph;
34219
+ if (typeof glyph !== "undefined") {
34220
+ var kerning = (lastGlyph && lastGlyph.kerning) ? lastGlyph.getKerning(ch) : 0;
34221
+ width += (glyph.xadvance + kerning) * this.ancestor.fontScale.x;
34222
+ lastGlyph = glyph;
34223
+ }
34193
34224
  }
34194
34225
  return width;
34195
34226
  }
@@ -35002,25 +35033,32 @@
35002
35033
  // calculate the char index
35003
35034
  var ch = string.charCodeAt(c);
35004
35035
  var glyph = this.fontData.glyphs[ch];
35005
- var glyphWidth = glyph.width;
35006
- var glyphHeight = glyph.height;
35007
- var kerning = (lastGlyph && lastGlyph.kerning) ? lastGlyph.getKerning(ch) : 0;
35008
-
35009
- // draw it
35010
- if (glyphWidth !== 0 && glyphHeight !== 0) {
35011
- // some browser throw an exception when drawing a 0 width or height image
35012
- renderer.drawImage(this.fontImage,
35013
- glyph.x, glyph.y,
35014
- glyphWidth, glyphHeight,
35015
- x + glyph.xoffset,
35016
- y + glyph.yoffset * this.fontScale.y,
35017
- glyphWidth * this.fontScale.x, glyphHeight * this.fontScale.y
35018
- );
35019
- }
35020
35036
 
35021
- // increment position
35022
- x += (glyph.xadvance + kerning) * this.fontScale.x;
35023
- lastGlyph = glyph;
35037
+ if (typeof glyph !== "undefined") {
35038
+ var glyphWidth = glyph.width;
35039
+ var glyphHeight = glyph.height;
35040
+ var kerning = (lastGlyph && lastGlyph.kerning) ? lastGlyph.getKerning(ch) : 0;
35041
+ var scaleX = this.fontScale.x;
35042
+ var scaleY = this.fontScale.y;
35043
+
35044
+ // draw it
35045
+ if (glyphWidth !== 0 && glyphHeight !== 0) {
35046
+ // some browser throw an exception when drawing a 0 width or height image
35047
+ renderer.drawImage(this.fontImage,
35048
+ glyph.x, glyph.y,
35049
+ glyphWidth, glyphHeight,
35050
+ x + glyph.xoffset * scaleX,
35051
+ y + glyph.yoffset * scaleY,
35052
+ glyphWidth * scaleX, glyphHeight * scaleY
35053
+ );
35054
+ }
35055
+
35056
+ // increment position
35057
+ x += (glyph.xadvance + kerning) * scaleX;
35058
+ lastGlyph = glyph;
35059
+ } else {
35060
+ console.warn("BitmapText: no defined Glyph in for " + String.fromCharCode(ch));
35061
+ }
35024
35062
  }
35025
35063
  // increment line
35026
35064
  y += stringHeight;
@@ -37686,7 +37724,7 @@
37686
37724
  * @name version
37687
37725
  * @type {string}
37688
37726
  */
37689
- var version = "13.2.1";
37727
+ var version = "13.4.0";
37690
37728
 
37691
37729
 
37692
37730
  /**