@urso/core 0.7.20 → 0.7.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.7.20",
3
+ "version": "0.7.22",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -12,6 +12,7 @@
12
12
  * @param isStroke - Is this drawing for the outside stroke of the
13
13
  * text? If not, it's for the inside fill
14
14
  */
15
+
15
16
  PIXI.Text.prototype.drawLetterSpacing = function (text, x, y, isStroke) {
16
17
  if (isStroke === void 0) { isStroke = false; }
17
18
  var style = this._style;
@@ -21,8 +22,9 @@ PIXI.Text.prototype.drawLetterSpacing = function (text, x, y, isStroke) {
21
22
  // https://developer.chrome.com/origintrials/#/view_trial/3585991203293757441
22
23
  // note: this is unstable API, Chrome less 94 use a `textLetterSpacing`, newest use a letterSpacing
23
24
  // eslint-disable-next-line max-len
24
- var supportLetterSpacing = 'letterSpacing' in CanvasRenderingContext2D.prototype
25
- || 'textLetterSpacing' in CanvasRenderingContext2D.prototype;
25
+ var supportLetterSpacing = PIXI.Text.experimentalLetterSpacing
26
+ && ('letterSpacing' in CanvasRenderingContext2D.prototype
27
+ || 'textLetterSpacing' in CanvasRenderingContext2D.prototype);
26
28
 
27
29
  if ((letterSpacing === 0 || supportLetterSpacing) && (!this.fillCustomColors || this.fillCustomColors.length === 0)) { //colors patch in if state
28
30
  if (supportLetterSpacing) {
@@ -37,11 +39,13 @@ PIXI.Text.prototype.drawLetterSpacing = function (text, x, y, isStroke) {
37
39
  }
38
40
  return;
39
41
  }
42
+
40
43
  var currentPosition = x;
41
44
 
42
45
  var textIndexOffset = this.text.indexOf(text); //colors patch block
43
46
  var allTextLength = this.text.length;
44
47
  var customColors = new Array(allTextLength);
48
+
45
49
  if (this.fillCustomColors) {
46
50
  for (var k in this.fillCustomColors) {
47
51
  var colorsParams = this.fillCustomColors[k];
@@ -59,6 +63,7 @@ PIXI.Text.prototype.drawLetterSpacing = function (text, x, y, isStroke) {
59
63
  var stringArray = Array.from ? Array.from(text) : text.split('');
60
64
  var previousWidth = this.context.measureText(text).width;
61
65
  var currentWidth = 0;
66
+
62
67
  for (var i = 0; i < stringArray.length; ++i) {
63
68
  var currentChar = stringArray[i];
64
69
 
@@ -72,6 +77,7 @@ PIXI.Text.prototype.drawLetterSpacing = function (text, x, y, isStroke) {
72
77
 
73
78
  this.context.fillText(currentChar, currentPosition, y);
74
79
  }
80
+
75
81
  currentWidth = this.context.measureText(text.substring(i + 1)).width;
76
82
  currentPosition += previousWidth - currentWidth + letterSpacing;
77
83
  previousWidth = currentWidth;
@@ -6,6 +6,10 @@ class ModulesObserverConfig {
6
6
  COMPONENTS_FULLSCREEN_CHANGE: 'components.fullscreen.change',
7
7
  COMPONENTS_FULLSCREEN_SWITCH: 'components.fullscreen.switch',
8
8
  COMPONENTS_LAYERS_SWITCHER_SWITCH: 'components.layersSwitcher.switch',
9
+ EXTRA_BROWSEREVENTS_POINTER_EVENT: 'extra.browserEvents.window.pointer.event',
10
+ EXTRA_BROWSEREVENTS_WINDOW_PRE_RESIZE: 'extra.browserEvents.window.pre.resize',
11
+ EXTRA_BROWSEREVENTS_WINDOW_RESIZE: 'extra.browserEvents.window.resize',
12
+ EXTRA_BROWSEREVENTS_WINDOW_VISIBILITYCHANGE: 'extra.browserEvents.window.visibilitychange',
9
13
  MODULES_ASSETS_GROUP_LOADED: 'modules.assets.group.loaded',
10
14
  MODULES_ASSETS_LOAD_PROGRESS: 'modules.assets.load.progress',
11
15
  MODULES_ASSETS_LAZYLOAD_FINISHED: 'modules.assets.lazyLoad.finished',
@@ -41,10 +45,6 @@ class ModulesObserverConfig {
41
45
  MODULES_SCENES_PAUSE: 'modules.scenes.pause',
42
46
  MODULES_SCENES_RESUME: 'modules.scenes.resume',
43
47
  MODULES_SCENES_UPDATE: 'modules.scenes.update',
44
- EXTRA_BROWSEREVENTS_POINTER_EVENT: 'extra.browserEvents.window.pointer.event',
45
- EXTRA_BROWSEREVENTS_WINDOW_PRE_RESIZE: 'extra.browserEvents.window.pre.resize',
46
- EXTRA_BROWSEREVENTS_WINDOW_RESIZE: 'extra.browserEvents.window.resize',
47
- EXTRA_BROWSEREVENTS_WINDOW_VISIBILITYCHANGE: 'extra.browserEvents.window.visibilitychange'
48
48
  }
49
49
  }
50
50
  }