mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 12:43:26 +00:00
Added XHRSettings Conf
This commit is contained in:
parent
f500f5509b
commit
13f5608cbe
26 changed files with 51 additions and 41 deletions
|
@ -89,7 +89,7 @@ var File = new Class({
|
|||
* The merged XHRSettings for this file.
|
||||
*
|
||||
* @name Phaser.Loader.File#xhrSettings
|
||||
* @type {Phaser.Loader.XHRSettings}
|
||||
* @type {Phaser.Loader.XHRSettingsConfig}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined));
|
||||
|
@ -109,10 +109,10 @@ var File = new Class({
|
|||
this.loader = null;
|
||||
|
||||
/**
|
||||
* The XHR Loader instance that is loading this File.
|
||||
* The XHR Loader function that is loading this File.
|
||||
*
|
||||
* @name Phaser.Loader.File#xhrLoader
|
||||
* @type {?Phaser.Loader.XHRLoader}
|
||||
* @type {?function}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.xhrLoader = null;
|
||||
|
@ -404,7 +404,7 @@ var File = new Class({
|
|||
*
|
||||
* @method Phaser.Loader.File.createObjectURL
|
||||
* @static
|
||||
* @param {Image} image - Image object which 'src' attribute should be set to object URL.
|
||||
* @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL.
|
||||
* @param {Blob} blob - A Blob object to create an object URL for.
|
||||
* @param {string} defaultType - Default mime type used if blob type is not available.
|
||||
*/
|
||||
|
@ -436,7 +436,7 @@ File.createObjectURL = function (image, blob, defaultType)
|
|||
*
|
||||
* @method Phaser.Loader.File.revokeObjectURL
|
||||
* @static
|
||||
* @param {Image} image - Image object which 'src' attribute should be revoked.
|
||||
* @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked.
|
||||
*/
|
||||
File.revokeObjectURL = function (image)
|
||||
{
|
||||
|
|
|
@ -122,7 +122,7 @@ var LoaderPlugin = new Class({
|
|||
* xhr specific global settings (can be overridden on a per-file basis)
|
||||
*
|
||||
* @name Phaser.Loader.LoaderPlugin#xhr
|
||||
* @type {Phaser.Loader.XHRSettings}
|
||||
* @type {Phaser.Loader.XHRSettingsConfig}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.xhr = XHRSettings(
|
||||
|
|
|
@ -16,10 +16,10 @@ var XHRSettings = require('./XHRSettings');
|
|||
* @function Phaser.Loader.MergeXHRSettings
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Loader.XHRSettings} global - The global XHRSettings object.
|
||||
* @param {Phaser.Loader.XHRSettings} local - The local XHRSettings object.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} global - The global XHRSettings object.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} local - The local XHRSettings object.
|
||||
*
|
||||
* @return {Phaser.Loader.XHRSettings} A newly formed XHRSettings object.
|
||||
* @return {Phaser.Loader.XHRSettingsConfig} A newly formed XHRSettings object.
|
||||
*/
|
||||
var MergeXHRSettings = function (global, local)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ var MergeXHRSettings = require('./MergeXHRSettings');
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Loader.File} file - The File to download.
|
||||
* @param {Phaser.Loader.XHRSettings} globalXHRSettings - The global XHRSettings object.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} globalXHRSettings - The global XHRSettings object.
|
||||
*
|
||||
* @return {XMLHttpRequest} The XHR object.
|
||||
*/
|
||||
|
|
|
@ -4,19 +4,29 @@
|
|||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} Phaser.Loader.XHRSettingsConfig
|
||||
*
|
||||
* @property {string} [responseType=''] - [description]
|
||||
* @property {boolean} [async=true] - [description]
|
||||
* @property {string} [user=''] - [description]
|
||||
* @property {string} [password=''] - [description]
|
||||
* @property {integer} [timeout=0] - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates an XHRSettings Object with default values.
|
||||
*
|
||||
* @function Phaser.Loader.XHRSettings
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string} [responseType] - The responseType, such as 'text'.
|
||||
* @param {string} [responseType=''] - The responseType, such as 'text'.
|
||||
* @param {boolean} [async=true] - Should the XHR request use async or not?
|
||||
* @param {string} [user] - Optional username for the XHR request.
|
||||
* @param {string} [password] - Optional password for the XHR request.
|
||||
* @param {string} [user=''] - Optional username for the XHR request.
|
||||
* @param {string} [password=''] - Optional password for the XHR request.
|
||||
* @param {integer} [timeout=0] - Optional XHR timeout value.
|
||||
*
|
||||
* @return {Phaser.Loader.XHRSettings} The XHRSettings object as used by the Loader.
|
||||
* @return {Phaser.Loader.XHRSettingsConfig} The XHRSettings object as used by the Loader.
|
||||
*/
|
||||
var XHRSettings = function (responseType, async, user, password, timeout)
|
||||
{
|
||||
|
|
|
@ -16,9 +16,9 @@ var JSONFile = require('./JSONFile.js');
|
|||
* @param {string} key - The key of the file within the loader.
|
||||
* @param {string} url - The url to load the file from.
|
||||
* @param {string} path - The path of the file.
|
||||
* @param {object} xhrSettings - Optional file specific XHR settings.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - Optional file specific XHR settings.
|
||||
*
|
||||
* @return {Phaser.Loader.FileTypes.AnimationJSONFile} A File instance to be added to the Loader.
|
||||
* @return {Phaser.Loader.FileTypes.JSONFile} A File instance to be added to the Loader.
|
||||
*/
|
||||
var AnimationJSONFile = function (key, url, path, xhrSettings)
|
||||
{
|
||||
|
|
|
@ -18,8 +18,8 @@ var JSONFile = require('./JSONFile.js');
|
|||
* @param {string} textureURL - The url to load the texture file from.
|
||||
* @param {string} atlasURL - The url to load the atlas file from.
|
||||
* @param {string} path - The path of the file.
|
||||
* @param {object} textureXhrSettings - Optional texture file specific XHR settings.
|
||||
* @param {object} atlasXhrSettings - Optional atlas file specific XHR settings.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} textureXhrSettings - Optional texture file specific XHR settings.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} atlasXhrSettings - Optional atlas file specific XHR settings.
|
||||
*
|
||||
* @return {object} An object containing two File objects to be added to the loader.
|
||||
*/
|
||||
|
|
|
@ -24,7 +24,7 @@ var HTML5AudioFile = require('./HTML5AudioFile');
|
|||
* @param {string} key - [description]
|
||||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
* @param {AudioContext} audioContext - [description]
|
||||
*/
|
||||
var AudioFile = new Class({
|
||||
|
|
|
@ -24,8 +24,8 @@ var JSONFile = require('./JSONFile.js');
|
|||
* @param {(string|string[])} urls - [description]
|
||||
* @param {object} json - [description]
|
||||
* @param {object} config - [description]
|
||||
* @param {object} audioXhrSettings - Optional file specific XHR settings.
|
||||
* @param {object} jsonXhrSettings - Optional file specific XHR settings.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} audioXhrSettings - Optional file specific XHR settings.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} jsonXhrSettings - Optional file specific XHR settings.
|
||||
*
|
||||
* @return {Phaser.Loader.LoaderPlugin} The Loader.
|
||||
*/
|
||||
|
|
|
@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
|
|||
* @param {string} key - [description]
|
||||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
*/
|
||||
var BinaryFile = new Class({
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ var XMLFile = require('./XMLFile.js');
|
|||
* @param {string} textureURL - The url to load the texture file from.
|
||||
* @param {string} xmlURL - The url to load the atlas file from.
|
||||
* @param {string} path - The path of the file.
|
||||
* @param {object} textureXhrSettings - Optional texture file specific XHR settings.
|
||||
* @param {object} xmlXhrSettings - Optional atlas file specific XHR settings.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} textureXhrSettings - Optional texture file specific XHR settings.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xmlXhrSettings - Optional atlas file specific XHR settings.
|
||||
*
|
||||
* @return {object} An object containing two File objects to be added to the loader.
|
||||
*/
|
||||
|
|
|
@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
|
|||
* @param {string} key - [description]
|
||||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
*/
|
||||
var GLSLFile = new Class({
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ var GetURL = require('../GetURL');
|
|||
* @param {string} key - [description]
|
||||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {object} config - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} config - [description]
|
||||
* @param {boolean} locked - [description]
|
||||
*/
|
||||
var HTML5AudioFile = new Class({
|
||||
|
|
|
@ -25,7 +25,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
|
|||
* @param {number} width - [description]
|
||||
* @param {number} height - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
*/
|
||||
var HTMLFile = new Class({
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
|
|||
* @param {string} key - [description]
|
||||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
* @param {object} config - [description]
|
||||
*/
|
||||
var ImageFile = new Class({
|
||||
|
|
|
@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
|
|||
* @param {string} key - [description]
|
||||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
*/
|
||||
var JSONFile = new Class({
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ var NumberArray = require('../../utils/array/NumberArray');
|
|||
* @param {string} key - [description]
|
||||
* @param {string[]} textureURLs - [description]
|
||||
* @param {string[]} atlasURLs - [description]
|
||||
* @param {object} textureXhrSettings - [description]
|
||||
* @param {object} atlasXhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} textureXhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} atlasXhrSettings - [description]
|
||||
*
|
||||
* @return {Phaser.Loader.LoaderPlugin} The Loader.
|
||||
*/
|
||||
|
|
|
@ -24,7 +24,7 @@ var PluginManager = require('../../boot/PluginManager');
|
|||
* @param {string} key - [description]
|
||||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
*/
|
||||
var PluginFile = new Class({
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
|
|||
* @param {string} key - [description]
|
||||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
*/
|
||||
var SVGFile = new Class({
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
|
|||
* @param {string} key - [description]
|
||||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
*/
|
||||
var ScriptFile = new Class({
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ var ImageFile = require('./ImageFile.js');
|
|||
* @param {string} url - The url to load the texture file from.
|
||||
* @param {object} config - Optional texture file specific XHR settings.
|
||||
* @param {string} path - Optional texture file specific XHR settings.
|
||||
* @param {object} xhrSettings - Optional atlas file specific XHR settings.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - Optional atlas file specific XHR settings.
|
||||
*
|
||||
* @return {object} An object containing two File objects to be added to the loader.
|
||||
*/
|
||||
|
|
|
@ -22,7 +22,7 @@ var FileTypesManager = require('../FileTypesManager');
|
|||
* @param {string} key - [description]
|
||||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
*/
|
||||
var TextFile = new Class({
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ var TILEMAP_FORMATS = require('../../tilemaps/Formats');
|
|||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {string} format - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
*/
|
||||
var TilemapCSVFile = new Class({
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ var TILEMAP_FORMATS = require('../../tilemaps/Formats');
|
|||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {string} format - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
*
|
||||
* @return {object} An object containing two File objects to be added to the loader.
|
||||
*/
|
||||
|
|
|
@ -18,8 +18,8 @@ var TextFile = require('./TextFile.js');
|
|||
* @param {string} textureURL - The url to load the texture file from.
|
||||
* @param {string} atlasURL - The url to load the atlas file from.
|
||||
* @param {string} path - The path of the file.
|
||||
* @param {object} textureXhrSettings - Optional texture file specific XHR settings.
|
||||
* @param {object} atlasXhrSettings - Optional atlas file specific XHR settings.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} textureXhrSettings - Optional texture file specific XHR settings.
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} atlasXhrSettings - Optional atlas file specific XHR settings.
|
||||
*
|
||||
* @return {object} An object containing two File objects to be added to the loader.
|
||||
*/
|
||||
|
|
|
@ -24,7 +24,7 @@ var ParseXML = require('../../dom/ParseXML');
|
|||
* @param {string} key - [description]
|
||||
* @param {string} url - [description]
|
||||
* @param {string} path - [description]
|
||||
* @param {object} xhrSettings - [description]
|
||||
* @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
|
||||
*/
|
||||
var XMLFile = new Class({
|
||||
|
||||
|
|
Loading…
Reference in a new issue