I’m experiencing some strange behaviour with the GUI.AdvancedDynamicTexture.CreateFullscreenUI when the user resizes the window. The text is much lower than the meshes it’s linked to:
I was able to somewhat fix this by dynamically setting the height of the GUIs canvas, like so:
engine.resize();
uiTexture.getContext().canvas.height = canvas.height;
But then I get this: (after a certain height the text starts to clip)
I’ve combed the documentation for the GUI.AdvancedDynamicTexture and there doesn’t seem to be a way to tell it to recalculate it’s size.
Note: I think the reason a lot of this is happening is that the height of my canvas is “flex” using CSS flexbox. Not shown in the code example is a hack I have to reset the canvas to the full height of it’s flexed container:
canvas.height = 1;
const rect = canvas.parentNode.getBoundingClientRect();
canvas.height = rect.height;
engine.resize();
uiTexture.getContext().canvas.height = canvas.height;