Hello again,
I’m using CreateScreenshot method and I realized that the TextBlock GUI (that i linked to a mesh), in the outputted image is positioned in a wrong way.
Here I’ve made a simple playground – to avoid a sudden download on your computer i’ve commented the createScreenshot method —> https://playground.babylonjs.com/#9CRB6R#3
Playing with it, i found that the text GUI has a static offset position related to the mesh it is attached to (only when downloading the image).
So if you move the textBox, you’ll see that the textBlock output will change position.
While when it’s rendered on real time, it’s position as it’s supposed to, so at the center of the cube.
I’ve also put in the playground a GUI Multiline, to show that it’s not a general GUI problem, but in this specific case, it affects the GUI Textblock.
Is there something I’m missing in the options?
I also saw that if you delay a little bit with setTimeout, it seems to generate a correct image.
Is that the only workaround?
@sebavan ah… haha that’s weird. Maybe createScreenshot to be sure it creates everything apart from the device speed of compilation, network performance ecc, needs this empty setTimeout.