# script.createLoadingScreen

Function · category: Script

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/framework/script.js#L47

```ts
createLoadingScreen(callback: CreateScreenCallback): void
```

Handles the creation of the loading screen of the application. A script can subscribe to the
events of a [AppBase](https://api.playcanvas.com/engine/classes/AppBase.md) to show a loading screen, progress bar etc. In order for
this to work you need to set the project's loading screen script to the script that calls
this method.

**Parameters**

- `callback` ([`CreateScreenCallback`](https://api.playcanvas.com/engine/types/CreateScreenCallback.md)): A function which can set up and tear down a
  customized loading screen.

**Example**

```ts
script.createLoadingScreen((app) => {
    const showSplashScreen = () => {};
    const hideSplashScreen = () => {};
    const showProgress = (progress) => {};
    app.on("preload:start", showSplashScreen);
    app.on("preload:progress", showProgress);
    app.on("start", hideSplashScreen);
});
```
