Text.setText will check if the value given is falsey but not a zero and set to an empty string if so.

This commit is contained in:
Richard Davey 2018-02-27 15:13:39 +00:00
parent 6b77ca6ae5
commit b447665533

View file

@ -490,13 +490,13 @@ var Text = new Class({
* @method Phaser.GameObjects.Text#setText
* @since 3.0.0
*
* @param {string|string[]} value - The text to set.
* @param {string|string[]} value - The string, or array of strings, to be set as the content of this Text object.
*
* @return {Phaser.GameObjects.Text} This Text object.
*/
setText: function (value)
{
if (!value)
if (!value && value !== 0)
{
value = '';
}