I’m having trouble loading local images in Babylon GUI when using a Babylon.js Editor project with Vite.
I’ve tried both approaches:
Adding an image through the Babylon.js Editor GUI Editor.
Creating a BABYLON.GUI.Image directly from code.
For example:
const image = new BABYLON.GUI.Image(
"myImage",
"assets/2d/android.png"
);
advancedTexture.addControl(image);
The image does not appear. I also tried different relative paths and checked that the image file exists in the project.
Interestingly, I can see that the image is being requested/loaded in some cases, but it still doesn’t render correctly. At one point I only got a blue rectangle instead of the image.
I’m using a Babylon.js Editor project with Vite and Babylon.js 9.12.1.
Thanks a lot for looking into this and for creating the issue! I really appreciate it.
One quick question: when the new release is available, will the Babylon.js Editor update automatically, or will I need to download/install the new version manually?
It’s normal!
Nothing special, you’ll just need to launch the editor and a notification on your computer will saying you have to restart it to apply the update
I’ll let you know once I deployed it