excalibur 0.26.0-alpha.332 → 0.26.0-alpha.333

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 (35) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/build/dist/Debug/Debug.d.ts +1 -0
  3. package/build/dist/Debug/Debug.js +1 -0
  4. package/build/dist/Debug/Debug.js.map +1 -1
  5. package/build/dist/Debug/DebugSystem.js +2 -0
  6. package/build/dist/Debug/DebugSystem.js.map +1 -1
  7. package/build/dist/Graphics/Context/debug-text.js +1 -1
  8. package/build/dist/Graphics/Context/debug-text.js.map +1 -1
  9. package/build/dist/Graphics/Font.d.ts +53 -22
  10. package/build/dist/Graphics/Font.js +185 -124
  11. package/build/dist/Graphics/Font.js.map +1 -1
  12. package/build/dist/Graphics/FontCommon.d.ts +43 -2
  13. package/build/dist/Graphics/FontCommon.js +3 -0
  14. package/build/dist/Graphics/FontCommon.js.map +1 -1
  15. package/build/dist/Graphics/SpriteFont.d.ts +3 -6
  16. package/build/dist/Graphics/SpriteFont.js +29 -35
  17. package/build/dist/Graphics/SpriteFont.js.map +1 -1
  18. package/build/dist/Graphics/Text.d.ts +18 -2
  19. package/build/dist/Graphics/Text.js +37 -26
  20. package/build/dist/Graphics/Text.js.map +1 -1
  21. package/build/dist/Util/DrawUtil.js +2 -0
  22. package/build/dist/Util/DrawUtil.js.map +1 -1
  23. package/build/dist/excalibur.js +263 -189
  24. package/build/dist/excalibur.js.map +1 -1
  25. package/build/dist/excalibur.min.js +2 -2
  26. package/build/dist/index.js +2 -2
  27. package/build/esm/Debug/Debug.d.ts +1 -0
  28. package/build/esm/Graphics/Font.d.ts +53 -22
  29. package/build/esm/Graphics/FontCommon.d.ts +43 -2
  30. package/build/esm/Graphics/SpriteFont.d.ts +3 -6
  31. package/build/esm/Graphics/Text.d.ts +18 -2
  32. package/build/esm/excalibur.js +263 -189
  33. package/build/esm/excalibur.js.map +1 -1
  34. package/build/esm/excalibur.min.js +2 -2
  35. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
22
22
 
23
23
  ### Added
24
24
 
25
+ - Added new `measureText` method to the `ex.SpriteFont` and `ex.Font` to return the bounds of any particular text
25
26
  - Added new `Clock` api to manage the core main loop. Clocks hide the implementation detail of how the mainloop runs, users just knows that it ticks somehow. Clocks additionally encapsulate any related browser timing, like `performance.now()`
26
27
  1. `StandardClock` encapsulates the existing `requestAnimationFrame` api logic
27
28
  2. `TestClock` allows a user to manually step the mainloop, this can be useful for frame by frame debugging #1170
@@ -35,6 +36,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
35
36
 
36
37
  ### Fixed
37
38
 
39
+ - Fixed issue [#2152] where shared state in `ex.Font` and `ex.SpriteFont` prevented text from aligning properly when re-used
38
40
  - Fixed issue where fast moving `CompositeCollider`s were erroneously generating pairs for their constituent parts
39
41
  - Fixed Safari 13.1 crash when booting Excalibur because of they odd MediaQuery API in older Safari
40
42
  - Fixed issue where pointers did not work because of missing types
@@ -53,6 +55,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
53
55
 
54
56
  ### Changed
55
57
 
58
+ - Chaned the debug system to separate displaying the debug position point (`game.debug.transform.showPosition = true`) and debug position label (`game.debug.transform.showPositionLabel = true`)
56
59
  - `ex.ColorBlindCorrector` is renamed to `ex.ColorBlindnessPostProcessor`, and `ex.ColorBlindness` is renamed to `ex.ColorBlindnessMode`
57
60
  - Color blindness can still be corrected or simulated:
58
61
  * `game.debug.colorBlindMode.correct(ex.ColorBlindnessMode.Deuteranope)`
@@ -176,6 +176,7 @@ export declare class Debug implements DebugFlags {
176
176
  transform: {
177
177
  showAll: boolean;
178
178
  showPosition: boolean;
179
+ showPositionLabel: boolean;
179
180
  positionColor: Color;
180
181
  showScale: boolean;
181
182
  scaleColor: Color;
@@ -53,6 +53,7 @@ export class Debug {
53
53
  this.transform = {
54
54
  showAll: false,
55
55
  showPosition: false,
56
+ showPositionLabel: false,
56
57
  positionColor: Color.Yellow,
57
58
  showScale: false,
58
59
  scaleColor: Color.Green,
@@ -1 +1 @@
1
- {"version":3,"file":"Debug.js","sourceRoot":"","sources":["../../../src/engine/Debug/Debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAmJjC;;;;GAIG;AACH,MAAM,OAAO,KAAK;IAGhB,YAAY,MAAc;QA6C1B;;WAEG;QACI,UAAK,GAAe;YACzB;;;eAGG;YACH,SAAS,EAAE,IAAI,UAAU,EAAE;YAE3B;;;eAGG;YACH,SAAS,EAAE,IAAI,UAAU,EAAE;SAC5B,CAAC;QAQF;;WAEG;QACI,WAAM,GAA6D;YACxE;;eAEG;YACH,SAAS,EAAE,KAAK;YAChB;;eAEG;YACH,SAAS,EAAE,EAAE;YACb;;eAEG;YACH,GAAG,EAAE,EAAE;SACR,CAAC;QAEF;;WAEG;QACI,WAAM,GAAG;YACd,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,KAAK;SAChB,CAAC;QAEF;;WAEG;QACI,cAAS,GAAG;YACjB,OAAO,EAAE,KAAK;YAEd,YAAY,EAAE,KAAK;YACnB,aAAa,EAAE,KAAK,CAAC,MAAM;YAE3B,SAAS,EAAE,KAAK;YAChB,UAAU,EAAE,KAAK,CAAC,KAAK;YAEvB,YAAY,EAAE,KAAK;YACnB,aAAa,EAAE,KAAK,CAAC,IAAI;SAC1B,CAAC;QAEF;;WAEG;QACI,aAAQ,GAAG;YAChB,OAAO,EAAE,KAAK;YAEd,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,KAAK,CAAC,MAAM;SAC1B,CAAC;QAEF;;WAEG;QACI,aAAQ,GAAG;YAChB,OAAO,EAAE,KAAK;YAEd,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,KAAK,CAAC,IAA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IAC3B,CAAC;IAED,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAED,IAAW,kBAAkB,CAAC,KAAa;QACzC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACnC,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,UAAU,CAAC,KAAa;QACjC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAW,WAAW,CAAC,KAAa;QAClC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC5B,CAAC;CACF"}
@@ -71,6 +71,8 @@ export class DebugSystem extends System {
71
71
  if (tx) {
72
72
  if (txSettings.showAll || txSettings.showPosition) {
73
73
  this._graphicsContext.debug.drawPoint(Vector.Zero, { size: 2, color: txSettings.positionColor });
74
+ }
75
+ if (txSettings.showAll || txSettings.showPositionLabel) {
74
76
  this._graphicsContext.debug.drawText(`pos${tx.pos.toString(2)}`, cursor);
75
77
  cursor = cursor.add(lineHeight);
76
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DebugSystem.js","sourceRoot":"","sources":["../../../src/engine/Debug/DebugSystem.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAU,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,I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AQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,GAAG,CAAC,kBAAkB,CAAC,CAAC;YACpD,IAAI,SAAS,EAAE;gBACb,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBAClE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAClE,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;aAClD;SACF;IACH,CAAC;IAED;;;OAGG;IACK,oBAAoB,CAAC,SAA6B;QACxD,qCAAqC;QACrC,IAAI,SAAS,CAAC,UAAU,KAAK,UAAU,CAAC,KAAK,EAAE;YAC7C,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;YAC7B,IAAI,IAAI,CAAC,OAAO,EAAE;gBAChB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;aAC1C;SACF;IACH,CAAC;IAED;;;OAGG;IACK,mBAAmB,CAAC,SAA6B;QACvD,IAAI,SAAS,CAAC,UAAU,KAAK,UAAU,CAAC,KAAK,EAAE;YAC7C,4BAA4B;YAC5B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;SACjC;IACH,CAAC;CACF"}
@@ -40,7 +40,7 @@ export class DebugText {
40
40
  */
41
41
  write(ctx, text, pos) {
42
42
  if (this._imageSource.isLoaded()) {
43
- this._spriteFont.render(ctx, text, pos.x, pos.y);
43
+ this._spriteFont.render(ctx, text, null, pos.x, pos.y);
44
44
  }
45
45
  }
46
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"debug-text.js","sourceRoot":"","sources":["../../../../src/engine/Graphics/Context/debug-text.ts"],"names":[],"mappings":"AAAA,OAAO,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
  import { Color } from '../Color';
4
4
  import { ExcaliburGraphicsContext } from './Context/ExcaliburGraphicsContext';
5
5
  import { BaseAlign, Direction, FontOptions, FontStyle, FontUnit, TextAlign, FontRenderer } from './FontCommon';
6
- import { Raster, RasterOptions } from './Raster';
7
- export declare class Font extends Raster implements FontRenderer {
8
- constructor(options?: FontOptions & RasterOptions);
6
+ import { Graphic, GraphicOptions } from './Graphic';
7
+ import { RasterOptions } from './Raster';
8
+ /**
9
+ * Represents a system or web font in Excalibur
10
+ *
11
+ * If no options specfied, the system sans-serif 10 pixel is used
12
+ *
13
+ * If loading a custom web font be sure to have the font loaded before you use it https://erikonarheim.com/posts/dont-test-fonts/
14
+ */
15
+ export declare class Font extends Graphic implements FontRenderer {
16
+ constructor(options?: FontOptions & GraphicOptions & RasterOptions);
9
17
  clone(): Font;
10
18
  /**
11
19
  * Font quality determines the size of the underlying rastered text, higher quality means less jagged edges.
@@ -13,9 +21,15 @@ export declare class Font extends Raster implements FontRenderer {
13
21
  *
14
22
  * You can think of quality as how zoomed in to the text you can get before seeing jagged edges.
15
23
  *
16
- * (Default 4)
24
+ * (Default 2)
17
25
  */
18
26
  quality: number;
27
+ padding: number;
28
+ smoothing: boolean;
29
+ lineWidth: number;
30
+ lineDash: number[];
31
+ color: Color;
32
+ strokeColor: Color;
19
33
  family: string;
20
34
  style: FontStyle;
21
35
  bold: boolean;
@@ -30,28 +44,45 @@ export declare class Font extends Raster implements FontRenderer {
30
44
  color?: Color;
31
45
  };
32
46
  get fontString(): string;
33
- private _text;
34
- private _lines;
35
47
  private _textBounds;
36
- private _textWidth;
37
- private _textHeight;
38
- get width(): number;
39
- set width(value: number);
40
- get height(): number;
41
- set height(value: number);
42
- private get _rasterWidth();
43
- private get _rasterHeight();
44
- private get _halfRasterWidth();
45
- private get _halfRasterHeight();
46
48
  get localBounds(): BoundingBox;
47
- protected _drawImage(ex: ExcaliburGraphicsContext, x: number, y: number): void;
49
+ protected _drawImage(_ex: ExcaliburGraphicsContext, _x: number, _y: number): void;
48
50
  protected _rotate(ex: ExcaliburGraphicsContext): void;
49
51
  protected _flip(ex: ExcaliburGraphicsContext): void;
50
- updateText(text: string): void;
51
- private _updateDimensions;
52
- protected _preDraw(ex: ExcaliburGraphicsContext, x: number, y: number): void;
52
+ /**
53
+ * Returns a BoundingBox that is the total size of the text including mutliple lines
54
+ *
55
+ * Does not include any padding or adjustment
56
+ * @param text
57
+ * @returns BoundingBox
58
+ */
59
+ measureText(text: string): BoundingBox;
60
+ private _setDimension;
53
61
  protected _postDraw(ex: ExcaliburGraphicsContext): void;
62
+ /**
63
+ * We need to identify bitmaps with more than just the text content
64
+ *
65
+ * Any properites that can change the rendering of the text
66
+ */
67
+ private _getRasterPropertiesHash;
68
+ protected _applyRasterProperites(ctx: CanvasRenderingContext2D, color: Color): void;
54
69
  private _applyFont;
55
- execute(ctx: CanvasRenderingContext2D): void;
56
- render(ex: ExcaliburGraphicsContext, text: string, x: number, y: number): void;
70
+ private _drawText;
71
+ private _textToBitmap;
72
+ private _bitmapUsage;
73
+ private _getTextBitmap;
74
+ render(ex: ExcaliburGraphicsContext, text: string, colorOverride: Color, x: number, y: number): void;
75
+ /**
76
+ * Get the internal cache size of the font
77
+ * This is useful when debugging memory useage, these numbers indicate the number of cached in memory text bitmaps
78
+ */
79
+ get cacheSize(): number;
80
+ /**
81
+ * Force clear all cached text bitmaps
82
+ */
83
+ clearCache(): void;
84
+ /**
85
+ * Remove any expired cached text bitmaps
86
+ */
87
+ checkAndClearCache(): void;
57
88
  }
@@ -2,20 +2,33 @@ import { BoundingBox } from '../Collision/Index';
2
2
  import { Color } from '../Color';
3
3
  import { line } from '../Util/DrawUtil';
4
4
  import { BaseAlign, Direction, FontStyle, FontUnit, TextAlign } from './FontCommon';
5
- import { Raster } from './Raster';
6
- export class Font extends Raster {
5
+ import { Graphic } from './Graphic';
6
+ /**
7
+ * Represents a system or web font in Excalibur
8
+ *
9
+ * If no options specfied, the system sans-serif 10 pixel is used
10
+ *
11
+ * If loading a custom web font be sure to have the font loaded before you use it https://erikonarheim.com/posts/dont-test-fonts/
12
+ */
13
+ export class Font extends Graphic {
7
14
  constructor(options = {}) {
8
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
9
- super(options);
15
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
16
+ super(options); // <- Graphics properties
10
17
  /**
11
18
  * Font quality determines the size of the underlying rastered text, higher quality means less jagged edges.
12
19
  * If quality is set to 1, then just enough raster bitmap is generated to render the text.
13
20
  *
14
21
  * You can think of quality as how zoomed in to the text you can get before seeing jagged edges.
15
22
  *
16
- * (Default 4)
23
+ * (Default 2)
17
24
  */
18
25
  this.quality = 2;
26
+ // Raster properties for fonts
27
+ this.padding = 0;
28
+ this.smoothing = false;
29
+ this.lineWidth = 1;
30
+ this.lineDash = [];
31
+ this.color = Color.Black;
19
32
  this.family = 'sans-serif';
20
33
  this.style = FontStyle.Normal;
21
34
  this.bold = false;
@@ -26,29 +39,35 @@ export class Font extends Raster {
26
39
  this.size = 10;
27
40
  this.shadow = null;
28
41
  this._textBounds = new BoundingBox();
29
- this._textWidth = 0;
30
- this._textHeight = 0;
31
- this.family = (_a = options === null || options === void 0 ? void 0 : options.family) !== null && _a !== void 0 ? _a : this.family;
32
- this.style = (_b = options === null || options === void 0 ? void 0 : options.style) !== null && _b !== void 0 ? _b : this.style;
33
- this.bold = (_c = options === null || options === void 0 ? void 0 : options.bold) !== null && _c !== void 0 ? _c : this.bold;
34
- this.size = (_d = options === null || options === void 0 ? void 0 : options.size) !== null && _d !== void 0 ? _d : this.size;
35
- this.unit = (_e = options === null || options === void 0 ? void 0 : options.unit) !== null && _e !== void 0 ? _e : this.unit;
36
- this.textAlign = (_f = options === null || options === void 0 ? void 0 : options.textAlign) !== null && _f !== void 0 ? _f : this.textAlign;
37
- this.baseAlign = (_g = options === null || options === void 0 ? void 0 : options.baseAlign) !== null && _g !== void 0 ? _g : this.baseAlign;
38
- this.direction = (_h = options === null || options === void 0 ? void 0 : options.direction) !== null && _h !== void 0 ? _h : this.direction;
39
- this.quality = (_j = options === null || options === void 0 ? void 0 : options.quality) !== null && _j !== void 0 ? _j : this.quality;
42
+ this._textToBitmap = new Map();
43
+ this._bitmapUsage = new Map();
44
+ // Raster properties
45
+ this.smoothing = (_a = options === null || options === void 0 ? void 0 : options.smoothing) !== null && _a !== void 0 ? _a : this.smoothing;
46
+ this.padding = (_b = options === null || options === void 0 ? void 0 : options.padding) !== null && _b !== void 0 ? _b : this.padding;
47
+ this.color = (_c = options === null || options === void 0 ? void 0 : options.color) !== null && _c !== void 0 ? _c : this.color;
48
+ this.strokeColor = (_d = options === null || options === void 0 ? void 0 : options.strokeColor) !== null && _d !== void 0 ? _d : this.strokeColor;
49
+ this.lineDash = (_e = options === null || options === void 0 ? void 0 : options.lineDash) !== null && _e !== void 0 ? _e : this.lineDash;
50
+ this.lineWidth = (_f = options === null || options === void 0 ? void 0 : options.lineWidth) !== null && _f !== void 0 ? _f : this.lineWidth;
51
+ // Font specific properts
52
+ this.family = (_g = options === null || options === void 0 ? void 0 : options.family) !== null && _g !== void 0 ? _g : this.family;
53
+ this.style = (_h = options === null || options === void 0 ? void 0 : options.style) !== null && _h !== void 0 ? _h : this.style;
54
+ this.bold = (_j = options === null || options === void 0 ? void 0 : options.bold) !== null && _j !== void 0 ? _j : this.bold;
55
+ this.size = (_k = options === null || options === void 0 ? void 0 : options.size) !== null && _k !== void 0 ? _k : this.size;
56
+ this.unit = (_l = options === null || options === void 0 ? void 0 : options.unit) !== null && _l !== void 0 ? _l : this.unit;
57
+ this.textAlign = (_m = options === null || options === void 0 ? void 0 : options.textAlign) !== null && _m !== void 0 ? _m : this.textAlign;
58
+ this.baseAlign = (_o = options === null || options === void 0 ? void 0 : options.baseAlign) !== null && _o !== void 0 ? _o : this.baseAlign;
59
+ this.direction = (_p = options === null || options === void 0 ? void 0 : options.direction) !== null && _p !== void 0 ? _p : this.direction;
60
+ this.quality = (_q = options === null || options === void 0 ? void 0 : options.quality) !== null && _q !== void 0 ? _q : this.quality;
40
61
  if (options === null || options === void 0 ? void 0 : options.shadow) {
41
62
  this.shadow = {};
42
- this.shadow.blur = (_k = options.shadow.blur) !== null && _k !== void 0 ? _k : this.shadow.blur;
43
- this.shadow.offset = (_l = options.shadow.offset) !== null && _l !== void 0 ? _l : this.shadow.offset;
44
- this.shadow.color = (_m = options.shadow.color) !== null && _m !== void 0 ? _m : this.shadow.color;
63
+ this.shadow.blur = (_r = options.shadow.blur) !== null && _r !== void 0 ? _r : this.shadow.blur;
64
+ this.shadow.offset = (_s = options.shadow.offset) !== null && _s !== void 0 ? _s : this.shadow.offset;
65
+ this.shadow.color = (_t = options.shadow.color) !== null && _t !== void 0 ? _t : this.shadow.color;
45
66
  }
46
- this.flagDirty();
47
67
  }
48
68
  clone() {
49
69
  return new Font({
50
70
  ...this.cloneGraphicOptions(),
51
- ...this.cloneRasterOptions(),
52
71
  size: this.size,
53
72
  unit: this.unit,
54
73
  family: this.family,
@@ -69,42 +88,11 @@ export class Font extends Raster {
69
88
  get fontString() {
70
89
  return `${this.style} ${this.bold ? 'bold' : ''} ${this.size}${this.unit} ${this.family}`;
71
90
  }
72
- get width() {
73
- return this._textWidth;
74
- }
75
- set width(value) {
76
- this._textWidth = value;
77
- }
78
- get height() {
79
- var _a, _b;
80
- const numLines = (_b = (_a = this._lines) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1;
81
- return this._textHeight * numLines;
82
- }
83
- set height(value) {
84
- var _a, _b;
85
- const numLines = (_b = (_a = this._lines) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 1;
86
- this._textHeight = value / numLines;
87
- }
88
- get _rasterWidth() {
89
- return this._bitmap.width;
90
- }
91
- get _rasterHeight() {
92
- return this._bitmap.height;
93
- }
94
- get _halfRasterWidth() {
95
- return Math.floor(this._bitmap.width / 2);
96
- }
97
- get _halfRasterHeight() {
98
- return Math.floor(this._bitmap.height / 2);
99
- }
100
91
  get localBounds() {
101
92
  return this._textBounds;
102
93
  }
103
- _drawImage(ex, x, y) {
104
- if (this.dirty) {
105
- this.rasterize();
106
- }
107
- ex.drawImage(this._bitmap, 0, 0, this._rasterWidth, this._rasterHeight, x - this._rasterWidth / this.quality / 2, y - this._rasterHeight / this.quality / 2, this._rasterWidth / this.quality, this._rasterHeight / this.quality);
94
+ _drawImage(_ex, _x, _y) {
95
+ // TODO weird vestigial drawimage
108
96
  }
109
97
  _rotate(ex) {
110
98
  var _a;
@@ -124,58 +112,80 @@ export class Font extends Raster {
124
112
  ex.scale(1, -1);
125
113
  }
126
114
  }
127
- updateText(text) {
128
- if (this._text !== text) {
129
- this._text = text;
130
- this._lines = this._text.split('\n');
131
- this._updateDimensions();
132
- this.flagDirty();
133
- }
134
- }
135
- _updateDimensions() {
136
- if (this._text) {
137
- this._applyFont(this._ctx);
138
- const maxWidthLine = this._lines.reduce((a, b) => {
139
- return a.length > b.length ? a : b;
140
- });
141
- const metrics = this._ctx.measureText(maxWidthLine);
142
- this._textWidth = Math.abs(metrics.actualBoundingBoxLeft) + Math.abs(metrics.actualBoundingBoxRight);
143
- this._textHeight = Math.abs(metrics.actualBoundingBoxAscent) + Math.abs(metrics.actualBoundingBoxDescent);
144
- // TODO lineheight makes the text bounds wonky
145
- const lineAdjustedHeight = this._textHeight * this._lines.length;
146
- // this._textHeight = lineAdjustedHeight;
147
- // Changing the width and height clears the context properties
148
- // We double the bitmap width to account for alignment
149
- // We scale by "quality" so we render text without jaggies
150
- this._bitmap.width = (this._textWidth + this.padding * 2) * 2 * this.quality;
151
- this._bitmap.height = (lineAdjustedHeight + this.padding * 2) * 2 * this.quality;
152
- // These bounds exist in raster bitmap space where the top left corner is the corder of the bitmap
153
- const x = 0;
154
- const y = 0;
155
- const bottomBounds = lineAdjustedHeight - Math.abs(metrics.actualBoundingBoxAscent);
156
- this._textBounds = new BoundingBox({
157
- left: x - Math.abs(metrics.actualBoundingBoxLeft) - this.padding,
158
- top: y - Math.abs(metrics.actualBoundingBoxAscent) - this.padding,
159
- bottom: y + bottomBounds + this.padding,
160
- right: x + Math.abs(metrics.actualBoundingBoxRight) + this.padding
161
- });
162
- }
115
+ /**
116
+ * Returns a BoundingBox that is the total size of the text including mutliple lines
117
+ *
118
+ * Does not include any padding or adjustment
119
+ * @param text
120
+ * @returns BoundingBox
121
+ */
122
+ measureText(text) {
123
+ const lines = text.split('\n');
124
+ const maxWidthLine = lines.reduce((a, b) => {
125
+ return a.length > b.length ? a : b;
126
+ });
127
+ const ctx = this._getTextBitmap(text);
128
+ this._applyFont(ctx); // font must be applied to the context to measure it
129
+ const metrics = ctx.measureText(maxWidthLine);
130
+ let textHeight = Math.abs(metrics.actualBoundingBoxAscent) + Math.abs(metrics.actualBoundingBoxDescent);
131
+ // TODO lineheight makes the text bounds wonky
132
+ const lineAdjustedHeight = textHeight * lines.length;
133
+ textHeight = lineAdjustedHeight;
134
+ const bottomBounds = lineAdjustedHeight - Math.abs(metrics.actualBoundingBoxAscent);
135
+ const x = 0;
136
+ const y = 0;
137
+ return new BoundingBox({
138
+ left: x - Math.abs(metrics.actualBoundingBoxLeft) - this.padding,
139
+ top: y - Math.abs(metrics.actualBoundingBoxAscent) - this.padding,
140
+ bottom: y + bottomBounds + this.padding,
141
+ right: x + Math.abs(metrics.actualBoundingBoxRight) + this.padding
142
+ });
163
143
  }
164
- _preDraw(ex, x, y) {
165
- if (this.dirty) {
166
- this._updateDimensions();
167
- }
168
- super._preDraw(ex, x, y);
144
+ _setDimension(text, bitmap) {
145
+ const textBounds = this.measureText(text);
146
+ // Changing the width and height clears the context properties
147
+ // We double the bitmap width to account for all possible alignment
148
+ // We scale by "quality" so we render text without jaggies
149
+ bitmap.canvas.width = (textBounds.width + this.padding * 2) * 2 * this.quality;
150
+ bitmap.canvas.height = (textBounds.height + this.padding * 2) * 2 * this.quality;
151
+ return textBounds;
169
152
  }
170
153
  _postDraw(ex) {
171
- if (this.showDebug) {
172
- /* istanbul ignore next */
173
- ex.debug.drawRect(-this._halfRasterWidth, -this._halfRasterHeight, this._rasterWidth, this._rasterHeight);
174
- }
175
154
  ex.restore();
176
155
  }
156
+ /**
157
+ * We need to identify bitmaps with more than just the text content
158
+ *
159
+ * Any properites that can change the rendering of the text
160
+ */
161
+ _getRasterPropertiesHash(color) {
162
+ var _a, _b;
163
+ const hash = '__hashcode__' +
164
+ this.fontString +
165
+ this.showDebug +
166
+ this.textAlign +
167
+ this.baseAlign +
168
+ this.direction +
169
+ JSON.stringify(this.shadow) +
170
+ (this.padding.toString() +
171
+ this.smoothing.toString() +
172
+ this.lineWidth.toString() +
173
+ this.lineDash.toString() +
174
+ ((_a = this.strokeColor) === null || _a === void 0 ? void 0 : _a.toString()) +
175
+ (color ? color.toString() : (_b = this.color) === null || _b === void 0 ? void 0 : _b.toString()).toString());
176
+ return hash;
177
+ }
178
+ _applyRasterProperites(ctx, color) {
179
+ var _a, _b, _c;
180
+ ctx.translate(this.padding, this.padding);
181
+ ctx.imageSmoothingEnabled = this.smoothing;
182
+ ctx.lineWidth = this.lineWidth;
183
+ ctx.setLineDash((_a = this.lineDash) !== null && _a !== void 0 ? _a : ctx.getLineDash());
184
+ ctx.strokeStyle = (_b = this.strokeColor) === null || _b === void 0 ? void 0 : _b.toString();
185
+ ctx.fillStyle = color ? color.toString() : (_c = this.color) === null || _c === void 0 ? void 0 : _c.toString();
186
+ }
177
187
  _applyFont(ctx) {
178
- ctx.translate(this.padding + this._halfRasterWidth, this.padding + this._halfRasterHeight);
188
+ ctx.translate(this.padding + ctx.canvas.width / 2, this.padding + ctx.canvas.height / 2);
179
189
  ctx.scale(this.quality, this.quality);
180
190
  ctx.textAlign = this.textAlign;
181
191
  ctx.textBaseline = this.baseAlign;
@@ -188,34 +198,85 @@ export class Font extends Raster {
188
198
  ctx.shadowOffsetY = this.shadow.offset.y;
189
199
  }
190
200
  }
191
- execute(ctx) {
192
- if (this._text) {
193
- // The reason we need to re-apply the font is setting raster properties (like width/height) can reset the context props
194
- this._applyRasterProperites(ctx);
195
- this._applyFont(ctx);
196
- const lineHeight = this._textHeight; // TODO user specified line height
197
- for (let i = 0; i < this._lines.length; i++) {
198
- const line = this._lines[i];
199
- if (this.color) {
200
- ctx.fillText(line, 0, i * lineHeight);
201
- }
202
- if (this.strokeColor) {
203
- ctx.strokeText(line, 0, i * lineHeight);
204
- }
201
+ _drawText(ctx, text, colorOverride, lineHeight) {
202
+ const lines = text.split('\n');
203
+ this._applyRasterProperites(ctx, colorOverride);
204
+ this._applyFont(ctx);
205
+ for (let i = 0; i < lines.length; i++) {
206
+ const line = lines[i];
207
+ if (this.color) {
208
+ ctx.fillText(line, 0, i * lineHeight);
205
209
  }
206
- if (this.showDebug) {
207
- // Horizontal line
208
- /* istanbul ignore next */
209
- line(ctx, Color.Red, -this._halfRasterWidth, 0, this._halfRasterWidth, 0, 2);
210
- // Vertical line
211
- /* istanbul ignore next */
212
- line(ctx, Color.Red, 0, -this._halfRasterHeight, 0, this._halfRasterHeight, 2);
210
+ if (this.strokeColor) {
211
+ ctx.strokeText(line, 0, i * lineHeight);
213
212
  }
214
213
  }
214
+ if (this.showDebug) {
215
+ // Horizontal line
216
+ /* istanbul ignore next */
217
+ line(ctx, Color.Red, -ctx.canvas.width / 2, 0, ctx.canvas.width / 2, 0, 2);
218
+ // Vertical line
219
+ /* istanbul ignore next */
220
+ line(ctx, Color.Red, 0, -ctx.canvas.height / 2, 0, ctx.canvas.height / 2, 2);
221
+ }
215
222
  }
216
- render(ex, text, x, y) {
217
- this.updateText(text);
218
- this.draw(ex, x, y);
223
+ _getTextBitmap(text, color) {
224
+ const textAndHash = text + this._getRasterPropertiesHash(color);
225
+ const bitmap = this._textToBitmap.get(textAndHash);
226
+ if (bitmap) {
227
+ return bitmap;
228
+ }
229
+ const canvas = document.createElement('canvas');
230
+ const ctx = canvas.getContext('2d');
231
+ this._textToBitmap.set(textAndHash, ctx);
232
+ return ctx;
233
+ }
234
+ render(ex, text, colorOverride, x, y) {
235
+ if (this.showDebug) {
236
+ this.clearCache();
237
+ }
238
+ this.checkAndClearCache();
239
+ const bitmap = this._getTextBitmap(text, colorOverride);
240
+ const bounds = this._setDimension(text, bitmap);
241
+ this._textBounds = bounds;
242
+ bitmap.canvas.width = (bounds.width + this.padding * 2) * 2 * this.quality;
243
+ bitmap.canvas.height = (bounds.height + this.padding * 2) * 2 * this.quality;
244
+ this._preDraw(ex, x, y);
245
+ const lines = text.split('\n');
246
+ const lineHeight = bounds.height / lines.length;
247
+ // draws the text to the bitmap
248
+ this._drawText(bitmap, text, colorOverride, lineHeight);
249
+ // Cache the bitmap for certain amount of time
250
+ this._bitmapUsage.set(bitmap, performance.now());
251
+ const rasterWidth = bitmap.canvas.width;
252
+ const rasterHeight = bitmap.canvas.height;
253
+ // draws the bitmap to excalibur graphics context
254
+ ex.drawImage(bitmap.canvas, 0, 0, rasterWidth, rasterHeight, x - rasterWidth / this.quality / 2, y - rasterHeight / this.quality / 2, rasterWidth / this.quality, rasterHeight / this.quality);
255
+ this._postDraw(ex);
256
+ }
257
+ /**
258
+ * Get the internal cache size of the font
259
+ * This is useful when debugging memory useage, these numbers indicate the number of cached in memory text bitmaps
260
+ */
261
+ get cacheSize() {
262
+ return this._bitmapUsage.size;
263
+ }
264
+ /**
265
+ * Force clear all cached text bitmaps
266
+ */
267
+ clearCache() {
268
+ this._bitmapUsage.clear();
269
+ }
270
+ /**
271
+ * Remove any expired cached text bitmaps
272
+ */
273
+ checkAndClearCache() {
274
+ for (const [bitmap, time] of this._bitmapUsage.entries()) {
275
+ // if bitmap hasn't been used in 1 second clear it
276
+ if (time + 1000 < performance.now()) {
277
+ this._bitmapUsage.delete(bitmap);
278
+ }
279
+ }
219
280
  }
220
281
  }
221
282
  //# sourceMappingURL=Font.js.map