Merge pull request #3514 from iamchristopher/feature-multi-image-loader

Fixed loading normals with multi image load
This commit is contained in:
Richard Davey 2018-04-26 13:04:49 +01:00 committed by GitHub
commit dbdd5a8d04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,11 +20,11 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @constructor
* @since 3.0.0
*
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
* @param {object} [config] - [description]
* @param {(string|object)} key - The name of the asset to load or an object representing the asset
* @param {string} [url] - The asset's filename
* @param {string} [path] - The path the asset can be found in
* @param {XHRSettingsObject} [xhrSettings] - Optional image specific XHR settings
* @param {object} [config] - config can include: frameWidth, frameHeight, startFrame, endFrame, margin, spacing
*/
var ImageFile = new Class({
@ -45,12 +45,26 @@ var ImageFile = new Class({
// headerValue: 'text/xml'
// }
// });
// this.load.image([
// {
// key: 'bunny',
// file: 'assets/sprites/bunny.png',
// xhr: {
// user: 'root',
// password: 'th3G1bs0n',
// timeout: 30,
// header: 'Content-Type',
// headerValue: 'text/xml'
// }
// }
// ]);
// this.load.image({ key: 'bunny' });
// this.load.image({ key: 'bunny', extension: 'jpg' });
function ImageFile (loader, key, url, xhrSettings, config)
{
var fileKey = (typeof key === 'string') ? key : GetFastValue(key, 'key', '');
var fileUrl = (url === undefined) ? GetFastValue(key, 'file') : url;
var fileConfig = {
type: 'image',
@ -58,7 +72,7 @@ var ImageFile = new Class({
extension: GetFastValue(key, 'extension', 'png'),
responseType: 'blob',
key: fileKey,
url: GetFastValue(key, 'file', url),
url: fileUrl,
path: loader.path,
xhrSettings: GetFastValue(key, 'xhr', xhrSettings),
config: GetFastValue(key, 'config', config)