Engine API Reference - v2.7.4
    Preparing search index...

    Function createLoadingScreen

    • Handles the creation of the loading screen of the application. A script can subscribe to the events of a AppBase 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

        A function which can set up and tear down a customized loading screen.

      Returns void

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