API Reference

Class List

pc.script

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

Summary

Static Methods

createLoadingScreenHandles 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 pc.Application 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

callbackpc.callbacks.CreateScreenA function which can set up and tear down a customised loading screen.