Skip to content

Commit b1a05a6

Browse files
committed
BitmapText.font failed to pull the new font from the Phaser Cache, stopping it from updating properly (thanks @AbrahamAlcaina phaserjs#2001)
1 parent 4c55ddd commit b1a05a6

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
264264

265265
### Updates
266266

267-
* TypeScript definitions fixes and updates (thanks @clark-stevenson @vrecluse @yahiko00)
268-
* JSDoc typo fixes (thanks @Cowa @yahiko00)
267+
* TypeScript definitions fixes and updates (thanks @clark-stevenson @vrecluse @yahiko00 @cloakedninjas @qdrj)
268+
* JSDoc typo fixes (thanks @Cowa @yahiko00 @qdrj)
269269
* VideoStream.active = false is used if the browser supports it, otherwise it falls back to VideoStream.stop.
270270
* Text can now accept `undefined` or `null` as the `text` argument in the constructor and will cast it as an empty string.
271271
* Point.rotate uses a faster and simpler rotation function when no distance argument is specified.
@@ -283,6 +283,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
283283
* Group.cacheAsBitmap would be incorrectly offset in Canvas mode (thanks @mkristo #1925)
284284
* Text.setTextBounds didn't add the x and y values to the width and height offsets.
285285
* Line.rotate used a calculation method which resulted in the line growing (or shrinking) in length over time, the more it was rotated. The new method never changes the lines length.
286+
* BitmapText.font failed to pull the new font from the Phaser Cache, stopping it from updating properly (thanks @AbrahamAlcaina #2001)
286287

287288
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
288289

src/gameobjects/BitmapText.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ Object.defineProperty(Phaser.BitmapText.prototype, 'font', {
526526
if (value !== this._font)
527527
{
528528
this._font = value.trim();
529+
this._data = this.game.cache.getBitmapFont(this._font);
529530
this.updateText();
530531
}
531532

0 commit comments

Comments
 (0)