Class: AudioSpriteFile

Phaser.Loader.FileTypes. AudioSpriteFile

An Audio Sprite File suitable for loading by the Loader.

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

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


new AudioSpriteFile(loader, key, jsonURL [, audioURL] [, audioConfig] [, audioXhrSettings] [, jsonXhrSettings])

Parameters:
Name Type Argument Description
loader Phaser.Loader.LoaderPlugin

A reference to the Loader that is responsible for this file.

key string | Phaser.Loader.FileTypes.AudioSpriteFileConfig

The key to use for this file, or a file configuration object.

jsonURL string

The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead.

audioURL Object <optional>

The absolute or relative URL to load the audio file from. If empty it will be obtained by parsing the JSON file.

audioConfig any <optional>

The audio configuration options.

audioXhrSettings XHRSettingsObject <optional>

An XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings.

jsonXhrSettings XHRSettingsObject <optional>

An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings.

Since: 3.7.0
Source: src/loader/filetypes/AudioSpriteFile.js (Line 26)

Extends

Members


complete :boolean

The completion status of this MultiFile.

Type:
  • boolean
Since: 3.7.0
Inherited From:
Default Value:
  • false
Source: src/loader/MultiFile.js (Line 68)

config :any

A storage container for transient data that the loading files need.

Type:
  • any
Since: 3.7.0
Inherited From:
Source: src/loader/MultiFile.js (Line 98)

failed :integer

The number of files that failed to load.

Type:
  • integer
Since: 3.7.0
Inherited From:
Default Value:
  • 0
Source: src/loader/MultiFile.js (Line 88)

files :Array.<Phaser.Loader.File>

Array of files that make up this MultiFile.

Type:
Since: 3.7.0
Inherited From:
Source: src/loader/MultiFile.js (Line 59)

key :string

Unique cache key (unique within its file type)

Type:
  • string
Since: 3.7.0
Inherited From:
Source: src/loader/MultiFile.js (Line 50)

loader :Phaser.Loader.LoaderPlugin

A reference to the Loader that is going to load this file.

Type:
Since: 3.7.0
Inherited From:
Source: src/loader/MultiFile.js (Line 32)

pending :integer

The number of files to load.

Type:
  • integer
Since: 3.7.0
Inherited From:
Source: src/loader/MultiFile.js (Line 78)

type :string

The file type string for sorting within the Loader.

Type:
  • string
Since: 3.7.0
Inherited From:
Source: src/loader/MultiFile.js (Line 41)

Methods


addToCache()

Adds this file to its target cache upon successful loading and processing.

Since: 3.7.0
Inherited From:
Source: src/loader/filetypes/MultiAtlasFile.js (Line 151)

addToMultiFile(files)

Adds another child to this MultiFile, increases the pending count and resets the completion status.

Parameters:
Name Type Description
files Phaser.Loader.File

The File to add to this MultiFile.

Since: 3.7.0
Inherited From:
Source: src/loader/MultiFile.js (Line 127)
Returns:

This MultiFile instance.

Type
Phaser.Loader.MultiFile

isReadyToProcess()

Checks if this MultiFile is ready to process its children or not.

Since: 3.7.0
Inherited From:
Source: src/loader/MultiFile.js (Line 114)
Returns:

true if all children of this MultiFile have loaded, otherwise false.

Type
boolean

onFileComplete(file)

Called by each File when it finishes loading.

Parameters:
Name Type Description
file Phaser.Loader.File

The File that has completed processing.

Since: 3.7.0
Inherited From:
Overrides:
Source: src/loader/filetypes/MultiAtlasFile.js (Line 78)

onFileFailed(file)

Called by each File that fails to load.

Parameters:
Name Type Description
file Phaser.Loader.File

The File that has failed to load.

Since: 3.7.0
Inherited From:
Source: src/loader/MultiFile.js (Line 168)