In order to get crisper UI, I added:
engine.setHardwareScalingLevel(1 / window.devicePixelRatio);
and
this.advancedTexture.rootContainer.scaleX = window.devicePixelRatio; this.advancedTexture.rootContainer.scaleY = window.devicePixelRatio;
and now when changing the verticalAlignment and horizontalAlignment, the control (in my case, a button) it is offset outside the screen relative to the viewport size
button1.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; button1.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT; button1.topInPixels = 0; button1.leftInPixels = 0;
Is this normal? How can I avoid this and still have the above button placed in the corner?
https://www.babylonjs-playground.com/#2ARI2W#42 // uncomment the 2 alignment lines and watch the button disappear. uncomment the top and left position lines to see the