You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const t = scene.add.text( 100, 100, `This is some game text. and some more here and here`, {
font: "20px GameFont",
color: "#ffffff"
})
It displays correctly in game.
If I print out the result of toJSON(), it's missing the font name and size:
{
...
"data": {
"autoRound": true,
"text": "This is some game text. and some more here and here",
"style": {
"fontFamily": "Courier",
"fontSize": "16px",
"fontStyle": "",
"backgroundColor": null,
"color": "#ffffff",
"testString": "|MÉqgy",
...
},
...
}
If, when creating the Text object, I don't use the font shorthand, the JSON result is correct:
const t = scene.add.text( 100, 100, `This is some game text. and some more here and here`, {
fontFamily: "GameFont",
fontSize: 20,
color: "#ffffff"
})
{
...
"data": {
"autoRound": true,
"text": "This is some game text. and some more here and here",
"style": {
"fontFamily": "GameFont",
"fontSize": "20px",
...
}
},
...
}
}
The text was updated successfully, but these errors were encountered:
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.
I'm using a Google font in my project, loaded like this:
In game, I'm displaying a Text field like so:
It displays correctly in game.
If I print out the result of
toJSON()
, it's missing the font name and size:If, when creating the Text object, I don't use the
font
shorthand, the JSON result is correct:The text was updated successfully, but these errors were encountered: