From b1a05a6f52409489f359db717643b4643fa83890 Mon Sep 17 00:00:00 2001 From: photonstorm Date: Tue, 18 Aug 2015 13:48:03 +0100 Subject: [PATCH] BitmapText.font failed to pull the new font from the Phaser Cache, stopping it from updating properly (thanks @AbrahamAlcaina #2001) --- README.md | 5 +++-- src/gameobjects/BitmapText.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3de36330f..32193b629 100644 --- a/README.md +++ b/README.md @@ -264,8 +264,8 @@ If you are an exceptional JavaScript developer and would like to join the Phaser ### Updates -* TypeScript definitions fixes and updates (thanks @clark-stevenson @vrecluse @yahiko00) -* JSDoc typo fixes (thanks @Cowa @yahiko00) +* TypeScript definitions fixes and updates (thanks @clark-stevenson @vrecluse @yahiko00 @cloakedninjas @qdrj) +* JSDoc typo fixes (thanks @Cowa @yahiko00 @qdrj) * VideoStream.active = false is used if the browser supports it, otherwise it falls back to VideoStream.stop. * Text can now accept `undefined` or `null` as the `text` argument in the constructor and will cast it as an empty string. * 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 * Group.cacheAsBitmap would be incorrectly offset in Canvas mode (thanks @mkristo #1925) * Text.setTextBounds didn't add the x and y values to the width and height offsets. * 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. +* BitmapText.font failed to pull the new font from the Phaser Cache, stopping it from updating properly (thanks @AbrahamAlcaina #2001) For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md). diff --git a/src/gameobjects/BitmapText.js b/src/gameobjects/BitmapText.js index 25f903d79..2a1e48fc4 100644 --- a/src/gameobjects/BitmapText.js +++ b/src/gameobjects/BitmapText.js @@ -526,6 +526,7 @@ Object.defineProperty(Phaser.BitmapText.prototype, 'font', { if (value !== this._font) { this._font = value.trim(); + this._data = this.game.cache.getBitmapFont(this._font); this.updateText(); }