Skip to main content
Version: Phaser v4.0.0

MultiScriptFile

A Multi Script File suitable for loading by the Loader.

These are created when you use the Phaser.Loader.LoaderPlugin#scripts method and are not typically created directly.

For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scripts.

Constructor

new MultiScriptFile(loader, key, [url], [xhrSettings])

Parameters

nametypeoptionaldescription
loaderPhaser.Loader.LoaderPluginNoA reference to the Loader that is responsible for this file.
keystring | Phaser.Types.Loader.FileTypes.MultiScriptFileConfigNoThe key to use for this file, or a file configuration object.
urlArray.<string>YesAn array of absolute or relative URLs to load the script files from. They are processed in the order given in the array.
xhrSettingsPhaser.Types.Loader.XHRSettingsObjectYesAn XHR Settings configuration object for the script files. Used in replacement of the Loaders default XHR Settings.

Scope: static

Extends

Phaser.Loader.MultiFile

Source: src/loader/filetypes/MultiScriptFile.js#L14
Since: 3.17.0

Inherited Methods

From Phaser.Loader.MultiFile:


Public Methods

addToCache

<instance> addToCache()

Description:

Called automatically by the Loader when all files in this MultiFile have finished loading. Creates a <script> element for each loaded file, sets the language to JavaScript, disables deferred execution, populates the element with the response text, and appends it to document.head in the exact order the files were specified. This causes each script to execute immediately in the correct order, preserving any inter-script dependencies.

Source: src/loader/filetypes/MultiScriptFile.js#L80
Since: 3.17.0


Inherited Members

From Phaser.Loader.MultiFile: