My devicePixelRatio is 2.625. If I don’t update scaleX/scaleY, the UI elements are shrunk down drastically.
Edit: the best workaround I’ve found so far is to not set the scaleX/scaleY properties (as per Evgeni’s suggestion) and instead just manually multiply values width, height, top, left and fontSize by the devicePixelRatio. This does take some care since values such as advancedTexture.getSize().width & height are already multiplied. For example, if I want to place an element 40 px above the bottom of the screen, the calculation for top is: this.advancedTexture.getSize().height - 40 * window.devicePixelRatio;
BTW: The playground example I am referencing is the “Crisp Text Resolution Example” referenced by the documentation at: GUI | Babylon.js Documentation