Loader

Loader

Classes

File
LoaderPlugin
MultiFile

Namespaces

Events
FileTypes
FileTypesManager

Members

(static) FILE_COMPLETE :number

Since:
  • 3.0.0
文件已完成处理.
Type:
  • number

(static) FILE_DESTROYED :number

Since:
  • 3.0.0
文件已被销毁
Type:
  • number

(static) FILE_ERRORED :number

Since:
  • 3.0.0
文件在处理过程中出现了某种错误.
Type:
  • number

(static) FILE_FAILED :number

Since:
  • 3.0.0
文件加载失败
Type:
  • number

(static) FILE_LOADED :number

Since:
  • 3.0.0
文件已成功加载,等待处理
Type:
  • number

(static) FILE_LOADING :number

Since:
  • 3.0.0
加载程序已开始加载文件(称为onLoad)
Type:
  • number

(static) FILE_PENDING :number

Since:
  • 3.0.0
文件在加载队列中,但尚未启动
Type:
  • number

(static) FILE_POPULATED :number

Since:
  • 3.0.0
文件由本地数据填充,不需要HTTP请求
Type:
  • number

(static) FILE_PROCESSING :number

Since:
  • 3.0.0
正在处理文件(onProcess回调)
Type:
  • number

(static) LOADER_COMPLETE :number

Since:
  • 3.0.0
加载程序已完成加载和处理.
Type:
  • number

(static) LOADER_DESTROYED :number

Since:
  • 3.0.0
装载器已被销毁.
Type:
  • number

(static) LOADER_IDLE :number

Since:
  • 3.0.0
装载机闲置.
Type:
  • number

(static) LOADER_LOADING :number

Since:
  • 3.0.0
装载机正在主动装载.
Type:
  • number

(static) LOADER_PROCESSING :number

Since:
  • 3.0.0
加载程序正在处理已加载的文件.
Type:
  • number

(static) LOADER_SHUTDOWN :number

Since:
  • 3.0.0
加载程序正在关闭.
Type:
  • number

Methods

(static) GetURL(file, baseURL) → {string}

Since:
  • 3.0.0
给定一个文件和一个基本网址值,这将返回文件将用于下载的网址.
Parameters:
Name Type Description
file Phaser.Loader.File 文件对象.
baseURL string 默认基本网址.
Returns:
文件将使用的网址.
Type
string

(static) MergeXHRSettings(global, local) → {Phaser.Types.Loader.XHRSettingsObject}

Since:
  • 3.0.0
获取两个Xhresettings对象,并从中创建一个新的Xhresettings对象. 新对象由全局设置中给定的值植入,但 局部对象覆盖全局对象.
Parameters:
Name Type Description
global Phaser.Types.Loader.XHRSettingsObject 全局XHRSettings对象.
local Phaser.Types.Loader.XHRSettingsObject 本地XHRSettings对象.
Returns:
新形成的XHRSettings对象.
Type
Phaser.Types.Loader.XHRSettingsObject

(static) XHRLoader(file, globalXHRSettings) → {XMLHttpRequest}

Since:
  • 3.0.0
基于给定的文件和XHRSettings创建一个新的XMLHttpRequest (xhr)对象 并开始下载.它使用文件自己的XHRSettings并合并它们 使用全局XHRSettings对象在下载前设置xhr值.
Parameters:
Name Type Description
file Phaser.Loader.File 要下载的文件.
globalXHRSettings Phaser.Types.Loader.XHRSettingsObject 全局XHRSettings对象.
Returns:
XHR物体.
Type
XMLHttpRequest

(static) XHRSettings(responseTypeopt, asyncopt, useropt, passwordopt, timeoutopt, withCredentialsopt) → {Phaser.Types.Loader.XHRSettingsObject}

Since:
  • 3.0.0
用默认值创建一个XHRSettings对象.
Parameters:
Name Type Attributes Default Description
responseType XMLHttpRequestResponseType <optional>
'' responseType,例如 `text` .
async boolean <optional>
true XHR请求是否应该使用异步?
user string <optional>
'' XHR请求的可选用户名.
password string <optional>
'' XHR请求的可选密码.
timeout number <optional>
0 可选的XHR超时值.
withCredentials boolean <optional>
false 可选XHR,带字母值.
Returns:
加载程序使用的XHRSettings对象.
Type
Phaser.Types.Loader.XHRSettingsObject