From 661f9fd29ef707047940298b87aa1b55274c95dc Mon Sep 17 00:00:00 2001 From: iamchristopher Date: Thu, 5 Apr 2018 20:12:58 -0400 Subject: [PATCH 1/7] Fixed loading normals with multi image load --- src/loader/filetypes/ImageFile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/loader/filetypes/ImageFile.js b/src/loader/filetypes/ImageFile.js index 90aaf7bda..026f44c07 100644 --- a/src/loader/filetypes/ImageFile.js +++ b/src/loader/filetypes/ImageFile.js @@ -51,13 +51,14 @@ var ImageFile = new Class({ function ImageFile (key, url, path, xhrSettings, config) { var fileKey = (typeof key === 'string') ? key : GetFastValue(key, 'key', ''); + if (url === undefined) url = GetFastValue(key, 'file'); var fileConfig = { type: 'image', extension: GetFastValue(key, 'extension', 'png'), responseType: 'blob', key: fileKey, - url: GetFastValue(key, 'file', url), + url: url, path: path, xhrSettings: GetFastValue(key, 'xhr', xhrSettings), config: GetFastValue(key, 'config', config) From 9155149012fad83e958acb97370117e6ec136168 Mon Sep 17 00:00:00 2001 From: iamchristopher Date: Thu, 5 Apr 2018 20:15:56 -0400 Subject: [PATCH 2/7] Added example multi image load --- src/loader/filetypes/ImageFile.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/loader/filetypes/ImageFile.js b/src/loader/filetypes/ImageFile.js index 026f44c07..8e6b669aa 100644 --- a/src/loader/filetypes/ImageFile.js +++ b/src/loader/filetypes/ImageFile.js @@ -45,6 +45,19 @@ 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' }); From a65cd41852fc879dcf8cc1ac82d0147c70edfe02 Mon Sep 17 00:00:00 2001 From: iamchristopher Date: Thu, 5 Apr 2018 20:34:49 -0400 Subject: [PATCH 3/7] Added ImageFile argument descriptions --- src/loader/filetypes/ImageFile.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/loader/filetypes/ImageFile.js b/src/loader/filetypes/ImageFile.js index 8e6b669aa..55b1ab2a9 100644 --- a/src/loader/filetypes/ImageFile.js +++ b/src/loader/filetypes/ImageFile.js @@ -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} 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({ From e538a597b327a28b0efcb6f00bf811d18474992f Mon Sep 17 00:00:00 2001 From: iamchristopher Date: Thu, 5 Apr 2018 20:42:32 -0400 Subject: [PATCH 4/7] Updated ImageFile argument types --- src/loader/filetypes/ImageFile.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/loader/filetypes/ImageFile.js b/src/loader/filetypes/ImageFile.js index 55b1ab2a9..a468bae69 100644 --- a/src/loader/filetypes/ImageFile.js +++ b/src/loader/filetypes/ImageFile.js @@ -20,11 +20,11 @@ var GetFastValue = require('../../utils/object/GetFastValue'); * @constructor * @since 3.0.0 * - * @param {string} 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 + * @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({ From 522d65e05e98ffa0cfe99116cffdb8925811b7a9 Mon Sep 17 00:00:00 2001 From: iamchristopher Date: Thu, 5 Apr 2018 20:45:00 -0400 Subject: [PATCH 5/7] Updated CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53414bb03..4b45c21d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ being passed to the simulation. The default value is 1 to remain consistent with * Line.getPointA and Line.getPointB incorrectly set the values into the Vector2 (thanks @Tomas2h) * DynamicTilemapLayer now uses the ComputedSize component, which stops it breaking if you call `setDisplaySize` (thanks Babsobar) * StaticTilemapLayer now uses the ComputedSize component, which stops it breaking if you call `setDisplaySize` (thanks Babsobar) +* Fixed loading normals with multi image load (thanks @iamchristopher) ### Updates From 135db3089ec615a9fc660d9cc41bd052a83e0618 Mon Sep 17 00:00:00 2001 From: iamchristopher Date: Wed, 11 Apr 2018 15:03:18 -0400 Subject: [PATCH 6/7] Fixed linting issue --- src/loader/filetypes/ImageFile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/loader/filetypes/ImageFile.js b/src/loader/filetypes/ImageFile.js index a468bae69..01cfbc21d 100644 --- a/src/loader/filetypes/ImageFile.js +++ b/src/loader/filetypes/ImageFile.js @@ -64,14 +64,14 @@ var ImageFile = new Class({ function ImageFile (key, url, path, xhrSettings, config) { var fileKey = (typeof key === 'string') ? key : GetFastValue(key, 'key', ''); - if (url === undefined) url = GetFastValue(key, 'file'); + var fileUrl = (url === undefined) ? GetFastValue(key, 'file') : url; var fileConfig = { type: 'image', extension: GetFastValue(key, 'extension', 'png'), responseType: 'blob', key: fileKey, - url: url, + url: fileUrl, path: path, xhrSettings: GetFastValue(key, 'xhr', xhrSettings), config: GetFastValue(key, 'config', config) From 674254e5d1987b460e0f7eb90fdc0e4586382233 Mon Sep 17 00:00:00 2001 From: iamchristopher Date: Sat, 21 Apr 2018 16:34:35 -0400 Subject: [PATCH 7/7] Removed update from CHANGELOG --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d626ff27..83086d274 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -219,7 +219,6 @@ A beta release of the new Container Game Object arrives in this version. We've f * If `setInteractive` is called on a Game Object that fails to set a hit area, it will no longer try to assign `dropZone` to an undefined `input` property. * The Matter SetBody Component will no longer try to call `setOrigin` unless the Game Object has the origin component (which not all do, like Graphics and Container) * Matter Image and Matter Sprite didn't define a `destroy` method, causing an error when trying to destroy the parent Game Object. Fix #3516 (thanks @RollinSafary) -* Fixed loading normals with multi image load (thanks @iamchristopher) ### Updates