Skip to content

Commit b447665

Browse files
committed
Text.setText will check if the value given is falsey but not a zero and set to an empty string if so.
1 parent 6b77ca6 commit b447665

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/gameobjects/text/static/Text.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,13 +490,13 @@ var Text = new Class({
490490
* @method Phaser.GameObjects.Text#setText
491491
* @since 3.0.0
492492
*
493-
* @param {string|string[]} value - The text to set.
493+
* @param {string|string[]} value - The string, or array of strings, to be set as the content of this Text object.
494494
*
495495
* @return {Phaser.GameObjects.Text} This Text object.
496496
*/
497497
setText: function (value)
498498
{
499-
if (!value)
499+
if (!value && value !== 0)
500500
{
501501
value = '';
502502
}

0 commit comments

Comments
 (0)