Resizing? - Default Loading Screen

I’d like to change the default loading screen image with a bigger one but I’ve noticed that it doesn’t resize on the height.

Do I need to add something else?

Just ctrl+R many times and resize the window

I think here is where I should be looking but I don’t really understand how to edit that?

// Resize
private _resizeLoadingUI = () => {
var canvasRect = this._renderingCanvas.getBoundingClientRect();
var canvasPositioning = window.getComputedStyle(this._renderingCanvas).position;
if (!this._loadingDiv) {
return;
}
this._loadingDiv.style.position = (canvasPositioning === “fixed”) ? “fixed” : “absolute”;
this._loadingDiv.style.left = canvasRect.left + “px”;
this._loadingDiv.style.top = canvasRect.top + “px”;
this._loadingDiv.style.width = canvasRect.width + “px”;
this._loadingDiv.style.height = canvasRect.height + “px”;
}

https://github.com/BabylonJS/Babylon.js/blob/master/src/Loading/loadingScreen.ts

Adding @RaananW

Hey,

not sure what exactly you are trying to achieve, but it is centered correctly if you set max height and width (so that they will fit in the canvas):

glTF Loader Demo | Babylon.js Playground

3 Likes

Yes, that’s exactly what I was missing. Working as expected now, thank you so much.

1 Like