Phaser API Documentation

  Version: 
Filter
Namespace: Loader
Phaser.Types.Loader

Namespace

Type Definitions

FileConfig
Focus
Focus
Properties:
name type arguments Default description
type string

The file type string (image, json, etc) for sorting within the Loader.

key string

Unique cache key (unique within its file type)

url object | string <optional>

The URL of the file, not including baseURL.

path string <optional>

The path of the file, not including the baseURL.

extension string <optional>

The default extension this file uses.

responseType XMLHttpRequestResponseType <optional>

The responseType to be used by the XHR request.

xhrSettings false | Phaser.Types.Loader.XHRSettingsObject <optional> false

Custom XHR Settings specific to this file and merged with the Loader defaults.

config any <optional>

A config object that can be used by file types to store transitional data.

textureURL string <optional>

The absolute or relative URL to load the texture image file from.

textureExtension string <optional> 'png'

The default file extension to use for the image texture if no url is provided.

textureXhrSettings Phaser.Types.Loader.XHRSettingsObject <optional>

Extra XHR Settings specifically for the texture image file.

atlasURL object | string <optional>

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

atlasExtension string <optional> 'json'

The default file extension to use for the atlas json if no url is provided.

atlasXhrSettings Phaser.Types.Loader.XHRSettingsObject <optional>

Extra XHR Settings specifically for the atlas json file.

normalMap string <optional>

The filename of an associated normal map. It uses the same path and url to load as the texture image.

context AudioContext <optional>

The optional AudioContext this file will use to process itself (only used by Sound objects).

jsonURL string <optional>

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

jsonXhrSettings Phaser.Types.Loader.XHRSettingsObject <optional>

Extra XHR Settings specifically for the json file.

audioURL Object <optional>

The absolute or relative URL to load the audio file from.

audioConfig any <optional>

The audio configuration options.

audioXhrSettings Phaser.Types.Loader.XHRSettingsObject <optional>

Extra XHR Settings specifically for the audio file.

dataType any <optional>

Optional type to cast the binary file to once loaded. For example, Uint8Array.

fontDataURL string <optional>

The absolute or relative URL to load the font data xml file from.

fontDataExtension string <optional> 'xml'

The default file extension to use for the font data xml if no url is provided.

fontDataXhrSettings Phaser.Types.Loader.XHRSettingsObject <optional>

Extra XHR Settings specifically for the font data xml file.

ETC string | Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry <optional>

The string, or file entry object, for an ETC format texture.

ETC1 string | Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry <optional>

The string, or file entry object, for an ETC1 format texture.

ATC string | Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry <optional>

The string, or file entry object, for an ATC format texture.

ASTC string | Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry <optional>

The string, or file entry object, for an ASTC format texture.

BPTC string | Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry <optional>

The string, or file entry object, for an BPTC format texture.

RGTC string | Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry <optional>

The string, or file entry object, for an RGTC format texture.

PVRTC string | Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry <optional>

The string, or file entry object, for an PVRTC format texture.

S3TC string | Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry <optional>

The string, or file entry object, for an S3TC format texture.

S3TCRGB string | Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry <optional>

The string, or file entry object, for an S3TCRGB format texture.

IMG string | Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry <optional>

The string, or file entry object, for the fallback image file.

shaderType string <optional> 'fragment'

The type of shader. Either fragment for a fragment shader, or vertex for a vertex shader. This is ignored if you load a shader bundle.

width number <optional> 512

The width of the texture the HTML will be rendered to.

height number <optional> 512

The height of the texture the HTML will be rendered to.

frameConfig Phaser.Types.Loader.FileTypes.ImageFrameConfig <optional>

The frame configuration object. Only provided for, and used by, Sprite Sheets.

dataKey string <optional>

If specified instead of the whole JSON file being parsed and added to the Cache, only the section corresponding to this property key will be added. If the property you want to extract is nested, use periods to divide it.

baseURL string <optional>

Optional Base URL to use when loading the textures defined in the atlas data.

flipUV boolean <optional>

Flip the UV coordinates stored in the model data?

matURL string <optional>

An optional absolute or relative URL to the object material file from. If undefined or null, no material file will be loaded.

matExtension string <optional> 'mat'

The default material file extension to use if no url is provided.

start boolean <optional> false

Automatically start the plugin after loading?

mapping string <optional>

If this plugin is to be injected into the Scene, this is the property key used.

systemKey string <optional>

If this plugin is to be added to Scene.Systems, this is the property key for it.

sceneKey string <optional>

If this plugin is to be added to the Scene, this is the property key for it.

svgConfig Phaser.Types.Loader.FileTypes.SVGSizeConfig <optional>

The svg size configuration object.

Type:
object
Since: 3.0.0
Focus
Focus
XHRSettingsObject
Focus
Focus
Properties:
name type arguments Default description
responseType XMLHttpRequestResponseType

The response type of the XHR request, i.e. blob, text, etc.

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 number <optional> 0

Optional XHR timeout value.

headers object | undefined <optional>

This value is used to populate the XHR setRequestHeader and is undefined by default.

header string | undefined <optional>

This value is used to populate the XHR setRequestHeader and is undefined by default.

headerValue string | undefined <optional>

This value is used to populate the XHR setRequestHeader and is undefined by default.

requestedWith string | undefined <optional>

This value is used to populate the XHR setRequestHeader and is undefined by default.

overrideMimeType string | undefined <optional>

Provide a custom mime-type to use instead of the default.

withCredentials boolean <optional> false

The withCredentials property indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. Setting withCredentials has no effect on same-site requests.

Type:
object
Since: 3.0.0
Focus
Focus