When using adaptive scaling, the font is adjusted only when you change the style or font of a control.
Should Control._fontSet initial be set to true?
Adding @msDestiny14 to double check ?
Yep. This looks like a simple issue I think I can take a look at in the next day and fix for you.
As a temporary work around you can set the styles directly like you did.
Hi again! I’ve come with an update, yay!
Took me sec where would be the best place for this would be. Decided on putting it with the other _fontset checks when the font hasn’t been initialized yet and useSmallestIdeal is true.
Check out the PR here. Enjoy
Hi msDestiny14, thank you for coming up with a PR. Instead of checking the useSmallestIdeal
what about checking idealWidth
and idealHeight
? See:
https://playground.babylonjs.com/#09JUM8#2
Maybe introduce a method AdvancedDynamicTexture.isUsingIdeal() { return this.idealWidth !== 0 || this.idealHeight !== 0; }
(Tell-Don’t-Ask)
You can set idealWidth and idealWidth but you need to set
renderAtIdealSize = true
or what you used: useSmallestIdeal = true
To have an effective change.
Fun fact I was actually going to recommend you try using renderAtIdealSize, until i realized they are not the same thing, and will result in blurry text because you are scaling down the texture to a really small size.
Hi, as told by the documentation one needs to set idealWidth
or idealHeight
for adaptive scaling.
useSmallestIdeal = true
requires both properties are set.
Hi, thought about this a little. I guess I could add a check to make sure useSmallestIdeal = true AND make sure the user set the idealWidth and idealHeight. Just checking with width and height though would not be enough since width and height are also used for renderAtIdealSize which should not effect this.
Hi @msDestiny14 just checking in if the changes were made or you want me to create an issue so we can keep track
Yes pls