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
Setting font on a BitmapText without changing the texture doesnt check the new font-size and ignores it.
Also ignores the align argument.
Expected behaviour
setFont('same-texture',48);
should work the same as:
setFont('same-texture').setFontSize(48);// This works fine
Example Test Code
classExampleextendsPhaser.Scene{preload(){this.load.bitmapFont('desyrel','assets/fonts/bitmap/desyrel.png','assets/fonts/bitmap/desyrel.xml');this.load.bitmapFont('desyrel-pink','assets/fonts/bitmap/desyrel-pink.png','assets/fonts/bitmap/desyrel-pink.xml');this.load.bitmapFont('shortStack','assets/fonts/bitmap/shortStack.png','assets/fonts/bitmap/shortStack.xml');}create(){constb2=this.add.bitmapText(400,400,'desyrel','Phaser test',40);b2.setFont('desyrel',12);console.warn(b2.fontSize);// It should be 12 but it is 40 // If the font changes it works fine// b2.setFont('shortStack', 12);// console.warn(b2.fontSize);}}constconfig={type: Phaser.WEBGL,parent: 'phaser-example',scene: Example};constgame=newPhaser.Game(config);
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.
Version
Description
Setting font on a BitmapText without changing the texture doesnt check the new font-size and ignores it.
Also ignores the align argument.
Expected behaviour
should work the same as:
Example Test Code
The text was updated successfully, but these errors were encountered: