From a3d2ccf65c4dbf8e3ee0a9964c50690856d93fa8 Mon Sep 17 00:00:00 2001 From: "J.C" Date: Thu, 13 Dec 2018 17:17:02 +0800 Subject: [PATCH 1/4] doc improvement for typescript --- src/textures/TextureManager.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/textures/TextureManager.js b/src/textures/TextureManager.js index e78d5643d..8b83e77ed 100644 --- a/src/textures/TextureManager.js +++ b/src/textures/TextureManager.js @@ -320,7 +320,7 @@ var TextureManager = new Class({ * * @param {string} key - The unique string-based key of the Texture. * @param {HTMLImageElement} source - The source Image element. - * @param {HTMLImageElement} [dataSource] - An optional data Image element. + * @param {HTMLImageElement|HTMLCanvasElement} [dataSource] - An optional data Image element. * * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. */ @@ -479,7 +479,7 @@ var TextureManager = new Class({ * @param {string} key - The unique string-based key of the Texture. * @param {HTMLImageElement} source - The source Image element. * @param {object} data - The Texture Atlas data. - * @param {HTMLImageElement} [dataSource] - An optional data Image element. + * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element. * * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. */ @@ -507,7 +507,7 @@ var TextureManager = new Class({ * @param {string} key - The unique string-based key of the Texture. * @param {(HTMLImageElement|HTMLImageElement[])} source - The source Image element/s. * @param {(object|object[])} data - The Texture Atlas data/s. - * @param {HTMLImageElement} [dataSource] - An optional data Image element. + * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element. * * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. */ @@ -559,7 +559,7 @@ var TextureManager = new Class({ * @param {string} key - The unique string-based key of the Texture. * @param {HTMLImageElement} source - The source Image element. * @param {object} data - The Texture Atlas data. - * @param {HTMLImageElement} [dataSource] - An optional data Image element. + * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element. * * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. */ @@ -604,7 +604,7 @@ var TextureManager = new Class({ * @param {string} key - The unique string-based key of the Texture. * @param {HTMLImageElement} source - The source Image element. * @param {object} data - The Texture Atlas XML data. - * @param {HTMLImageElement} [dataSource] - An optional data Image element. + * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element. * * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. */ @@ -639,7 +639,7 @@ var TextureManager = new Class({ * @param {string} key - The unique string-based key of the Texture. * @param {HTMLImageElement} source - The source Image element. * @param {object} data - The Texture Atlas data. - * @param {HTMLImageElement} [dataSource] - An optional data Image element. + * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element. * * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. */ From b6c2934e651c3902cca67757c1eeed13f511e1a5 Mon Sep 17 00:00:00 2001 From: "J.C" Date: Thu, 13 Dec 2018 17:17:09 +0800 Subject: [PATCH 2/4] doc improvement for typescript --- src/textures/Texture.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/textures/Texture.js b/src/textures/Texture.js index 93428ed3f..17a9a1174 100644 --- a/src/textures/Texture.js +++ b/src/textures/Texture.js @@ -29,7 +29,7 @@ var TEXTURE_MISSING_ERROR = 'Texture.frame missing: '; * * @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to. * @param {string} key - The unique string-based key of this Texture. - * @param {(HTMLImageElement[]|HTMLCanvasElement[])} source - An array of sources that are used to create the texture. Usually Images, but can also be a Canvas. + * @param {(HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[])} source - An array of sources that are used to create the texture. Usually Images, but can also be a Canvas. * @param {number} [width] - The width of the Texture. This is optional and automatically derived from the source images. * @param {number} [height] - The height of the Texture. This is optional and automatically derived from the source images. */ @@ -385,7 +385,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#setDataSource * @since 3.0.0 * - * @param {(HTMLImageElement|HTMLCanvasElement)} data - The source image. + * @param {(HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[])} data - The source image. */ setDataSource: function (data) { From b7424fd2876d3667dc7ad06732d7577a44cb5826 Mon Sep 17 00:00:00 2001 From: "J.C" Date: Thu, 13 Dec 2018 17:19:49 +0800 Subject: [PATCH 3/4] 1, removed `protected` for a few of members, they are used publicly somewhere, for example `this.loader.textureManager.addAtlasJSONArray` in MultiAtlasFile.prototype.addCache. 2, doc improvement for typescript --- src/loader/LoaderPlugin.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/loader/LoaderPlugin.js b/src/loader/LoaderPlugin.js index 46ae0c70d..c0cccdfbb 100644 --- a/src/loader/LoaderPlugin.js +++ b/src/loader/LoaderPlugin.js @@ -65,7 +65,6 @@ var LoaderPlugin = new Class({ * * @name Phaser.Loader.LoaderPlugin#scene * @type {Phaser.Scene} - * @protected * @since 3.0.0 */ this.scene = scene; @@ -75,7 +74,6 @@ var LoaderPlugin = new Class({ * * @name Phaser.Loader.LoaderPlugin#systems * @type {Phaser.Scenes.Systems} - * @protected * @since 3.0.0 */ this.systems = scene.sys; @@ -85,7 +83,6 @@ var LoaderPlugin = new Class({ * * @name Phaser.Loader.LoaderPlugin#cacheManager * @type {Phaser.Cache.CacheManager} - * @protected * @since 3.7.0 */ this.cacheManager = scene.sys.cache; @@ -95,7 +92,6 @@ var LoaderPlugin = new Class({ * * @name Phaser.Loader.LoaderPlugin#textureManager * @type {Phaser.Textures.TextureManager} - * @protected * @since 3.7.0 */ this.textureManager = scene.sys.textures; From 5d696d49bfca342ba4b3bcd05edf1e87099e96fc Mon Sep 17 00:00:00 2001 From: "J.C" Date: Thu, 13 Dec 2018 17:26:10 +0800 Subject: [PATCH 4/4] doc improvement for typescript, missing `mapping` if use JSON as the config data for the game instance --- src/boot/Config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/boot/Config.js b/src/boot/Config.js index ec7c70666..d03e31544 100644 --- a/src/boot/Config.js +++ b/src/boot/Config.js @@ -165,6 +165,7 @@ var ValueToColor = require('../display/color/ValueToColor'); * @property {boolean} [start] - Whether the plugin should be started automatically. * @property {string} [systemKey] - For a scene plugin, add the plugin to the scene's systems object under this key (`this.sys.KEY`, from the scene). * @property {string} [sceneKey] - For a scene plugin, add the plugin to the scene object under this key (`this.KEY`, from the scene). + * @property {string} [mapping] - If this plugin is to be injected into the Scene Systems, this is the property key map used. * @property {*} [data] - Arbitrary data passed to the plugin's init() method. * * @example