Skip to content

Commit 7d9a4f4

Browse files
committed
Phaser.Text wouldn't render the text to its local canvas if you passed the text on the constructor and didn't add it to the display list. If a string is given it now updates the local canvas on creation.
1 parent 0d486aa commit 7d9a4f4

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ Version 2.1.0 - "Cairhien" - -in development-
143143
* BitmapData now returns a reference to itself from all of its drawing related methods, allowing for easy function chaining.
144144
* The default size of a BitmapData if no width/height is given has been changed from 100x100 to 256x256.
145145
* Phaser.Text.destroy will now destroy the base texture by default (#1162)
146+
* BitmapData.copyPixels is now called BitmapData.copyRect and the method signature has changed.
147+
* BitmapData.draw method signature has changed significantly.
146148

147149
### Bug Fixes
148150

@@ -178,6 +180,7 @@ Version 2.1.0 - "Cairhien" - -in development-
178180
* P2.World.getSprings used to return an empty array, but now returns all the Springs in the world (#1134)
179181
* Tween.generateData would skip the end values in the data array. They are now included as the object in the final array element.
180182
* Rectangle.bottom setter swapped the order of the calculation (thanks @JakeCoxon #1165)
183+
* Phaser.Text wouldn't render the text to its local canvas if you passed the text on the constructor and didn't add it to the display list. If a string is given it now updates the local canvas on creation.
181184

182185
### p2.js 0.6.0 Changes and New Features
183186

src/gameobjects/Text.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ Phaser.Text = function (game, x, y, text, style) {
134134
*/
135135
this._cache = [ 0, 0, 0, 0, 1, 0, 1, 0, 0 ];
136136

137+
if (text !== ' ')
138+
{
139+
this.updateText();
140+
}
141+
137142
};
138143

139144
Phaser.Text.prototype = Object.create(PIXI.Text.prototype);

0 commit comments

Comments
 (0)