Namespace: Loader

Phaser. Loader

Classes

File
LoaderPlugin
MultiFile

Namespaces

FileTypes

Members


<static> FILE_COMPLETE :integer

File has finished processing.

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 117)

<static> FILE_DESTROYED :integer

File has been destroyed

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 126)

<static> FILE_ERRORED :integer

The File has errored somehow during processing.

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 108)

<static> FILE_FAILED :integer

File failed to load

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 90)

<static> FILE_LOADED :integer

File has loaded successfully, awaiting processing

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 81)

<static> FILE_LOADING :integer

File has been started to load by the loader (onLoad called)

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 72)

<static> FILE_PENDING :integer

File is in the load queue but not yet started

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 63)

<static> FILE_POPULATED :integer

File was populated from local data and doesn't need an HTTP request

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 135)

<static> FILE_PROCESSING :integer

File is being processed (onProcess callback)

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 99)

<static> LOADER_COMPLETE :integer

The Loader has completed loading and processing.

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 36)

<static> LOADER_DESTROYED :integer

The Loader has been destroyed.

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 54)

<static> LOADER_IDLE :integer

The Loader is idle.

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 9)

<static> LOADER_LOADING :integer

The Loader is actively loading.

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 18)

<static> LOADER_PROCESSING :integer

The Loader is processing files is has loaded.

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 27)

<static> LOADER_SHUTDOWN :integer

The Loader is shutting down.

Type:
  • integer
Since: 3.0.0
Source: src/loader/const.js (Line 45)

Methods


<static> GetURL(file, baseURL)

Given a File and a baseURL value this returns the URL the File will use to download from.

Parameters:
Name Type Description
file Phaser.Loader.File

The File object.

baseURL string

A default base URL.

Since: 3.0.0
Source: src/loader/GetURL.js (Line 7)
Returns:

The URL the File will use.

Type
string

<static> MergeXHRSettings(global, local)

Takes two XHRSettings Objects and creates a new XHRSettings object from them.

The new object is seeded by the values given in the global settings, but any setting in
the local object overrides the global ones.

Parameters:
Name Type Description
global XHRSettingsObject

The global XHRSettings object.

local XHRSettingsObject

The local XHRSettings object.

Since: 3.0.0
Source: src/loader/MergeXHRSettings.js (Line 10)
Returns:

A newly formed XHRSettings object.

Type
XHRSettingsObject

<static> XHRLoader(file, globalXHRSettings)

Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings
and starts the download of it. It uses the Files own XHRSettings and merges them
with the global XHRSettings object to set the xhr values before download.

Parameters:
Name Type Description
file Phaser.Loader.File

The File to download.

globalXHRSettings XHRSettingsObject

The global XHRSettings object.

Since: 3.0.0
Source: src/loader/XHRLoader.js (Line 9)
Returns:

The XHR object.

Type
XMLHttpRequest

<static> XHRSettings( [responseType] [, async] [, user] [, password] [, timeout])

Creates an XHRSettings Object with default values.

Parameters:
Name Type Argument Default Description
responseType XMLHttpRequestResponseType <optional>
''

The responseType, such as 'text'.

async boolean <optional>
true

Should the XHR request use async or not?

user string <optional>
''

Optional username for the XHR request.

password string <optional>
''

Optional password for the XHR request.

timeout integer <optional>
0

Optional XHR timeout value.

Since: 3.0.0
Source: src/loader/XHRSettings.js (Line 21)
Returns:

The XHRSettings object as used by the Loader.

Type
XHRSettingsObject