API Reference

Class List

script

The script namespace holds the createLoadingScreen function that is used to override the default PlayCanvas loading screen.

Summary

Static Methods

createLoadingScreen

Handles the creation of the loading screen of the application.

Details

Static Methods

createLoadingScreen(callback)

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.

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

Parameters

callbackCreateScreenCallback

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