Skip to main content
Version: Phaser v3.88.2

Types.Loader

FileConfig

<static> FileConfig

nametypeoptionaldefaultdescription
typestringNoThe name of the Loader method that loads this file, e.g., 'image', 'json', 'spritesheet'.
keystringNoUnique cache key (unique within its file type)
urlobject | stringYesThe URL of the file, not including baseURL.
pathstringYesThe path of the file, not including the baseURL.
extensionstringYesThe default extension this file uses.
responseTypeXMLHttpRequestResponseTypeYesThe responseType to be used by the XHR request.
xhrSettingsPhaser.Types.Loader.XHRSettingsObject | falseYesfalseCustom XHR Settings specific to this file and merged with the Loader defaults.
configanyYesA config object that can be used by file types to store transitional data.
textureURLstringYesThe absolute or relative URL to load the texture image file from.
textureExtensionstringYes"'png'"The default file extension to use for the image texture if no url is provided.
textureXhrSettingsPhaser.Types.Loader.XHRSettingsObjectYesExtra XHR Settings specifically for the texture image file.
atlasURLobject | stringYesThe absolute or relative URL to load the atlas json file from. Or, a well formed JSON object to use instead.
atlasExtensionstringYes"'json'"The default file extension to use for the atlas json if no url is provided.
atlasXhrSettingsPhaser.Types.Loader.XHRSettingsObjectYesExtra XHR Settings specifically for the atlas json file.
normalMapstringYesThe filename of an associated normal map. It uses the same path and url to load as the texture image.
contextAudioContextYesThe optional AudioContext this file will use to process itself (only used by Sound objects).
jsonURLstringYesThe absolute or relative URL to load the json file from. Or a well formed JSON object to use instead.
jsonXhrSettingsPhaser.Types.Loader.XHRSettingsObjectYesExtra XHR Settings specifically for the json file.
audioURLObjectYesThe absolute or relative URL to load the audio file from.
audioConfiganyYesThe audio configuration options.
audioXhrSettingsPhaser.Types.Loader.XHRSettingsObjectYesExtra XHR Settings specifically for the audio file.
dataTypeanyYesOptional type to cast the binary file to once loaded. For example, Uint8Array.
fontDataURLstringYesThe absolute or relative URL to load the font data xml file from.
fontDataExtensionstringYes"'xml'"The default file extension to use for the font data xml if no url is provided.
fontDataXhrSettingsPhaser.Types.Loader.XHRSettingsObjectYesExtra XHR Settings specifically for the font data xml file.
ETCPhaser.Types.Loader.FileTypes.CompressedTextureFileEntry | stringYesThe string, or file entry object, for an ETC format texture.
ETC1Phaser.Types.Loader.FileTypes.CompressedTextureFileEntry | stringYesThe string, or file entry object, for an ETC1 format texture.
ATCPhaser.Types.Loader.FileTypes.CompressedTextureFileEntry | stringYesThe string, or file entry object, for an ATC format texture.
ASTCPhaser.Types.Loader.FileTypes.CompressedTextureFileEntry | stringYesThe string, or file entry object, for an ASTC format texture.
BPTCPhaser.Types.Loader.FileTypes.CompressedTextureFileEntry | stringYesThe string, or file entry object, for an BPTC format texture.
RGTCPhaser.Types.Loader.FileTypes.CompressedTextureFileEntry | stringYesThe string, or file entry object, for an RGTC format texture.
PVRTCPhaser.Types.Loader.FileTypes.CompressedTextureFileEntry | stringYesThe string, or file entry object, for an PVRTC format texture.
S3TCPhaser.Types.Loader.FileTypes.CompressedTextureFileEntry | stringYesThe string, or file entry object, for an S3TC format texture.
S3TCSRGBPhaser.Types.Loader.FileTypes.CompressedTextureFileEntry | stringYesThe string, or file entry object, for an S3TCSRGB format texture.
IMGPhaser.Types.Loader.FileTypes.CompressedTextureFileEntry | stringYesThe string, or file entry object, for the fallback image file.
shaderTypestringYes"'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.
widthnumberYes512The width of the texture the HTML will be rendered to.
heightnumberYes512The height of the texture the HTML will be rendered to.
frameConfigPhaser.Types.Loader.FileTypes.ImageFrameConfigYesThe frame configuration object. Only provided for, and used by, Sprite Sheets.
dataKeystringYesIf 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.
baseURLstringYesOptional Base URL to use when loading the textures defined in the atlas data.
flipUVbooleanYesFlip the UV coordinates stored in the model data?
matURLstringYesAn optional absolute or relative URL to the object material file from. If undefined or null, no material file will be loaded.
matExtensionstringYes"'mat'"The default material file extension to use if no url is provided.
startbooleanYesfalseAutomatically start the plugin after loading?
mappingstringYesIf this plugin is to be injected into the Scene, this is the property key used.
systemKeystringYesIf this plugin is to be added to Scene.Systems, this is the property key for it.
sceneKeystringYesIf this plugin is to be added to the Scene, this is the property key for it.
svgConfigPhaser.Types.Loader.FileTypes.SVGSizeConfigYesThe svg size configuration object.
maxRetriesnumberYes2The number of times to retry the file load if it fails.

Type: object

Member of: Phaser.Types.Loader

Source: src/loader/typedefs/FileConfig.js#L1
Since: 3.0.0


XHRSettingsObject

<static> XHRSettingsObject

nametypeoptionaldefaultdescription
responseTypeXMLHttpRequestResponseTypeNoThe response type of the XHR request, i.e. blob, text, etc.
asyncbooleanYestrueShould the XHR request use async or not?
userstringYes"''"Optional username for the XHR request.
passwordstringYes"''"Optional password for the XHR request.
timeoutnumberYes0Optional XHR timeout value.
headersobject | undefinedYesThis value is used to populate the XHR setRequestHeader and is undefined by default.
headerstring | undefinedYesThis value is used to populate the XHR setRequestHeader and is undefined by default.
headerValuestring | undefinedYesThis value is used to populate the XHR setRequestHeader and is undefined by default.
requestedWithstring | undefinedYesThis value is used to populate the XHR setRequestHeader and is undefined by default.
overrideMimeTypestring | undefinedYesProvide a custom mime-type to use instead of the default.
withCredentialsbooleanYesfalseThe 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

Member of: Phaser.Types.Loader

Source: src/loader/typedefs/XHRSettingsObject.js#L1
Since: 3.0.0