From dea68135fd198bb11f817a3d865083e643542f7d Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Mon, 13 Jul 2020 13:29:01 +0100 Subject: [PATCH] Correct texture type. Fix #5199 --- CHANGELOG.md | 2 +- src/gameobjects/image/Image.js | 2 +- src/gameobjects/image/ImageFactory.js | 2 +- src/gameobjects/mesh/Mesh.js | 6 +++--- src/gameobjects/mesh/MeshFactory.js | 2 +- src/gameobjects/particles/ParticleManagerFactory.js | 2 +- src/gameobjects/pathfollower/PathFollower.js | 4 ++-- src/gameobjects/pathfollower/PathFollowerFactory.js | 2 +- src/gameobjects/quad/Quad.js | 2 +- src/gameobjects/quad/QuadFactory.js | 8 ++++---- src/gameobjects/rope/RopeFactory.js | 2 +- src/gameobjects/sprite/Sprite.js | 2 +- src/gameobjects/sprite/SpriteFactory.js | 2 +- src/gameobjects/tilesprite/TileSpriteFactory.js | 2 +- src/physics/arcade/ArcadeImage.js | 2 +- src/physics/arcade/ArcadeSprite.js | 2 +- src/physics/arcade/Factory.js | 6 +++--- src/physics/matter-js/MatterImage.js | 4 ++-- src/physics/matter-js/MatterSprite.js | 2 +- 19 files changed, 28 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a086acde..644c153b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,7 +64,7 @@ My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs: -@samme @SanderVanhove @SirJosh3917 @mooreInteractive @A-312 @lozzajp @mikewesthad +@samme @SanderVanhove @SirJosh3917 @mooreInteractive @A-312 @lozzajp @mikewesthad @j-waters ## Version 3.23 - Ginro - 27th April 2020 diff --git a/src/gameobjects/image/Image.js b/src/gameobjects/image/Image.js index f87a6e1f5..d04977e42 100644 --- a/src/gameobjects/image/Image.js +++ b/src/gameobjects/image/Image.js @@ -42,7 +42,7 @@ var ImageRender = require('./ImageRender'); * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Image = new Class({ diff --git a/src/gameobjects/image/ImageFactory.js b/src/gameobjects/image/ImageFactory.js index 8335defa5..28155edff 100644 --- a/src/gameobjects/image/ImageFactory.js +++ b/src/gameobjects/image/ImageFactory.js @@ -17,7 +17,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.Image} The Game Object that was created. diff --git a/src/gameobjects/mesh/Mesh.js b/src/gameobjects/mesh/Mesh.js index 302328849..6f4ecb573 100644 --- a/src/gameobjects/mesh/Mesh.js +++ b/src/gameobjects/mesh/Mesh.js @@ -38,7 +38,7 @@ var NOOP = require('../../utils/NOOP'); * @param {number[]} uv - An array containing the uv data for this Mesh. * @param {number[]} colors - An array containing the color data for this Mesh. * @param {number[]} alphas - An array containing the alpha data for this Mesh. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Mesh = new Class({ @@ -137,7 +137,7 @@ var Mesh = new Class({ /** * Fill or additive mode used when blending the color values? - * + * * @name Phaser.GameObjects.Mesh#tintFill * @type {boolean} * @default false @@ -154,7 +154,7 @@ var Mesh = new Class({ /** * This method is left intentionally empty and does not do anything. * It is retained to allow a Mesh or Quad to be added to a Container. - * + * * @method Phaser.GameObjects.Mesh#setAlpha * @since 3.17.0 */ diff --git a/src/gameobjects/mesh/MeshFactory.js b/src/gameobjects/mesh/MeshFactory.js index c83e1da44..51324c745 100644 --- a/src/gameobjects/mesh/MeshFactory.js +++ b/src/gameobjects/mesh/MeshFactory.js @@ -22,7 +22,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * @param {number[]} uv - An array containing the uv data for this Mesh. * @param {number[]} colors - An array containing the color data for this Mesh. * @param {number[]} alphas - An array containing the alpha data for this Mesh. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.Mesh} The Game Object that was created. diff --git a/src/gameobjects/particles/ParticleManagerFactory.js b/src/gameobjects/particles/ParticleManagerFactory.js index 0781f2258..622496ef5 100644 --- a/src/gameobjects/particles/ParticleManagerFactory.js +++ b/src/gameobjects/particles/ParticleManagerFactory.js @@ -15,7 +15,7 @@ var ParticleEmitterManager = require('./ParticleEmitterManager'); * @method Phaser.GameObjects.GameObjectFactory#particles * @since 3.0.0 * - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer|object)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create. * diff --git a/src/gameobjects/pathfollower/PathFollower.js b/src/gameobjects/pathfollower/PathFollower.js index 677344ddd..fed1e701a 100644 --- a/src/gameobjects/pathfollower/PathFollower.js +++ b/src/gameobjects/pathfollower/PathFollower.js @@ -26,14 +26,14 @@ var Sprite = require('../sprite/Sprite'); * @memberof Phaser.GameObjects * @constructor * @since 3.0.0 - * + * * @extends Phaser.GameObjects.Components.PathFollower * * @param {Phaser.Scene} scene - The Scene to which this PathFollower belongs. * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var PathFollower = new Class({ diff --git a/src/gameobjects/pathfollower/PathFollowerFactory.js b/src/gameobjects/pathfollower/PathFollowerFactory.js index b3f389217..fefd84c6c 100644 --- a/src/gameobjects/pathfollower/PathFollowerFactory.js +++ b/src/gameobjects/pathfollower/PathFollowerFactory.js @@ -18,7 +18,7 @@ var PathFollower = require('./PathFollower'); * @param {Phaser.Curves.Path} path - The Path this PathFollower is connected to. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.PathFollower} The Game Object that was created. diff --git a/src/gameobjects/quad/Quad.js b/src/gameobjects/quad/Quad.js index 517a6cb48..f37c9e70d 100644 --- a/src/gameobjects/quad/Quad.js +++ b/src/gameobjects/quad/Quad.js @@ -27,7 +27,7 @@ var Mesh = require('../mesh/Mesh'); * @param {Phaser.Scene} scene - The Scene to which this Quad belongs. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Quad = new Class({ diff --git a/src/gameobjects/quad/QuadFactory.js b/src/gameobjects/quad/QuadFactory.js index 42c1dd32e..a1e53e167 100644 --- a/src/gameobjects/quad/QuadFactory.js +++ b/src/gameobjects/quad/QuadFactory.js @@ -18,9 +18,9 @@ var GameObjectFactory = require('../GameObjectFactory'); * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - * + * * @return {Phaser.GameObjects.Quad} The Game Object that was created. */ if (typeof WEBGL_RENDERER) @@ -32,9 +32,9 @@ if (typeof WEBGL_RENDERER) } // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/rope/RopeFactory.js b/src/gameobjects/rope/RopeFactory.js index 91fea53dd..1420438c0 100644 --- a/src/gameobjects/rope/RopeFactory.js +++ b/src/gameobjects/rope/RopeFactory.js @@ -18,7 +18,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.Math.Vector2Like[]} [points] - An array containing the vertices data for this Rope. If none is provided a simple quad is created. See `setPoints` to set this post-creation. * @param {boolean} [horizontal=true] - Should the vertices of this Rope be aligned horizontally (`true`), or vertically (`false`)? diff --git a/src/gameobjects/sprite/Sprite.js b/src/gameobjects/sprite/Sprite.js index 0035eabd9..916df9144 100644 --- a/src/gameobjects/sprite/Sprite.js +++ b/src/gameobjects/sprite/Sprite.js @@ -45,7 +45,7 @@ var SpriteRender = require('./SpriteRender'); * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Sprite = new Class({ diff --git a/src/gameobjects/sprite/SpriteFactory.js b/src/gameobjects/sprite/SpriteFactory.js index 1db62f293..66ba73f8d 100644 --- a/src/gameobjects/sprite/SpriteFactory.js +++ b/src/gameobjects/sprite/SpriteFactory.js @@ -17,7 +17,7 @@ var Sprite = require('./Sprite'); * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.Sprite} The Game Object that was created. diff --git a/src/gameobjects/tilesprite/TileSpriteFactory.js b/src/gameobjects/tilesprite/TileSpriteFactory.js index 679897ac8..ae80a41f1 100644 --- a/src/gameobjects/tilesprite/TileSpriteFactory.js +++ b/src/gameobjects/tilesprite/TileSpriteFactory.js @@ -19,7 +19,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * @param {number} y - The vertical position of this Game Object in the world. * @param {integer} width - The width of the Game Object. If zero it will use the size of the texture frame. * @param {integer} height - The height of the Game Object. If zero it will use the size of the texture frame. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.TileSprite} The Game Object that was created. diff --git a/src/physics/arcade/ArcadeImage.js b/src/physics/arcade/ArcadeImage.js index 2bab27da0..31f739355 100644 --- a/src/physics/arcade/ArcadeImage.js +++ b/src/physics/arcade/ArcadeImage.js @@ -50,7 +50,7 @@ var Image = require('../../gameobjects/image/Image'); * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ArcadeImage = new Class({ diff --git a/src/physics/arcade/ArcadeSprite.js b/src/physics/arcade/ArcadeSprite.js index 5d579afee..8b739fb04 100644 --- a/src/physics/arcade/ArcadeSprite.js +++ b/src/physics/arcade/ArcadeSprite.js @@ -51,7 +51,7 @@ var Sprite = require('../../gameobjects/sprite/Sprite'); * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ArcadeSprite = new Class({ diff --git a/src/physics/arcade/Factory.js b/src/physics/arcade/Factory.js index f71972eea..753c4d255 100644 --- a/src/physics/arcade/Factory.js +++ b/src/physics/arcade/Factory.js @@ -123,7 +123,7 @@ var Factory = new Class({ * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.ImageWithStaticBody} The Image object that was created. @@ -147,7 +147,7 @@ var Factory = new Class({ * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.ImageWithDynamicBody} The Image object that was created. @@ -171,7 +171,7 @@ var Factory = new Class({ * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.SpriteWithStaticBody} The Sprite object that was created. diff --git a/src/physics/matter-js/MatterImage.js b/src/physics/matter-js/MatterImage.js index 5c226f3d4..1a0490dd1 100644 --- a/src/physics/matter-js/MatterImage.js +++ b/src/physics/matter-js/MatterImage.js @@ -15,7 +15,7 @@ var Vector2 = require('../../math/Vector2'); /** * @classdesc * A Matter Physics Image Game Object. - * + * * An Image is a light-weight Game Object useful for the display of static images in your game, * such as logos, backgrounds, scenery or other non-animated elements. Images can have input * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an @@ -56,7 +56,7 @@ var Vector2 = require('../../math/Vector2'); * @param {Phaser.Physics.Matter.World} world - A reference to the Matter.World instance that this body belongs to. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. */ diff --git a/src/physics/matter-js/MatterSprite.js b/src/physics/matter-js/MatterSprite.js index 3b0e53a2b..cc0f0d438 100644 --- a/src/physics/matter-js/MatterSprite.js +++ b/src/physics/matter-js/MatterSprite.js @@ -60,7 +60,7 @@ var Vector2 = require('../../math/Vector2'); * @param {Phaser.Physics.Matter.World} world - A reference to the Matter.World instance that this body belongs to. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. */