From e017691c68ade9fe88296db8ccc522babe5d2e6a Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Sun, 24 Mar 2019 23:07:27 +0000 Subject: [PATCH] The `ScaleMode` Component has been removed from every Game Object, and along with it the `scaleMode` property and `setScaleMode` method. These did nothing anyway as they were not hooked to the render pipeline and scale mode should be set on the texture, not the Game Object. Fix #4413 --- CHANGELOG.md | 1 + .../bitmaptext/static/BitmapText.js | 2 - src/gameobjects/blitter/Blitter.js | 2 - src/gameobjects/components/ScaleMode.js | 65 ------------------- src/gameobjects/components/index.js | 1 - src/gameobjects/extern/Extern.js | 2 - src/gameobjects/image/Image.js | 2 - src/gameobjects/mesh/Mesh.js | 2 - .../rendertexture/RenderTexture.js | 2 - src/gameobjects/shape/Shape.js | 2 - src/gameobjects/sprite/Sprite.js | 2 - src/gameobjects/text/static/Text.js | 2 - src/gameobjects/tilesprite/TileSprite.js | 2 - src/gameobjects/zone/Zone.js | 2 - src/physics/arcade/ArcadeImage.js | 1 - src/physics/arcade/ArcadeSprite.js | 1 - src/physics/impact/ImpactImage.js | 1 - src/physics/impact/ImpactSprite.js | 1 - src/physics/matter-js/MatterImage.js | 1 - src/physics/matter-js/MatterSprite.js | 1 - .../dynamiclayer/DynamicTilemapLayer.js | 1 - .../staticlayer/StaticTilemapLayer.js | 1 - 22 files changed, 1 insertion(+), 96 deletions(-) delete mode 100644 src/gameobjects/components/ScaleMode.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 02e54bc8b9..890ba51078 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ Notes: * The return from the `ScenePlugin.add` method has changed. Previously, it would return the ScenePlugin, but now it returns a reference to the Scene that was added to the Scene Manager, keeping it in-line with all other `add` methods in the API. Fix #4359 (thanks @BigZaphod) * The `PluginManager.installScenePlugin` method has a new optional boolean parameter `fromLoader` which controls if the plugin is coming in from the result of a Loader operation or not. If it is, it no longer throws a console warning if the plugin already exists. This fixes an issue where if you return to a Scene that loads a Scene Plugin it would throw a warning and then not install the plugin to the Scene. * The Scale Manager has a new event `FULLSCREEN_FAILED` which is fired if you try to enter fullscreen mode, but the browser rejects it for some reason. +* The `ScaleMode` Component has been removed from every Game Object, and along with it the `scaleMode` property and `setScaleMode` method. These did nothing anyway as they were not hooked to the render pipeline and scale mode should be set on the texture, not the Game Object. Fix #4413 (thanks @jcyuan) ### Bug Fixes diff --git a/src/gameobjects/bitmaptext/static/BitmapText.js b/src/gameobjects/bitmaptext/static/BitmapText.js index 5616af08cd..15864a1160 100644 --- a/src/gameobjects/bitmaptext/static/BitmapText.js +++ b/src/gameobjects/bitmaptext/static/BitmapText.js @@ -45,7 +45,6 @@ var Render = require('./BitmapTextRender'); * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Texture * @extends Phaser.GameObjects.Components.Tint @@ -71,7 +70,6 @@ var BitmapText = new Class({ Components.Mask, Components.Origin, Components.Pipeline, - Components.ScaleMode, Components.ScrollFactor, Components.Texture, Components.Tint, diff --git a/src/gameobjects/blitter/Blitter.js b/src/gameobjects/blitter/Blitter.js index dd74fb7bae..567ac4c82a 100644 --- a/src/gameobjects/blitter/Blitter.js +++ b/src/gameobjects/blitter/Blitter.js @@ -46,7 +46,6 @@ var List = require('../../structs/List'); * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Size * @extends Phaser.GameObjects.Components.Texture @@ -69,7 +68,6 @@ var Blitter = new Class({ Components.Depth, Components.Mask, Components.Pipeline, - Components.ScaleMode, Components.ScrollFactor, Components.Size, Components.Texture, diff --git a/src/gameobjects/components/ScaleMode.js b/src/gameobjects/components/ScaleMode.js deleted file mode 100644 index 70c046f857..0000000000 --- a/src/gameobjects/components/ScaleMode.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2019 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */ - -var ScaleModes = require('../../renderer/ScaleModes'); - -/** - * Provides methods used for getting and setting the scale of a Game Object. - * - * @namespace Phaser.GameObjects.Components.ScaleMode - * @since 3.0.0 - */ - -var ScaleMode = { - - _scaleMode: ScaleModes.DEFAULT, - - /** - * The Scale Mode being used by this Game Object. - * Can be either `ScaleModes.LINEAR` or `ScaleModes.NEAREST`. - * - * @name Phaser.GameObjects.Components.ScaleMode#scaleMode - * @type {Phaser.ScaleModes} - * @since 3.0.0 - */ - scaleMode: { - - get: function () - { - return this._scaleMode; - }, - - set: function (value) - { - if (value === ScaleModes.LINEAR || value === ScaleModes.NEAREST) - { - this._scaleMode = value; - } - } - - }, - - /** - * Sets the Scale Mode being used by this Game Object. - * Can be either `ScaleModes.LINEAR` or `ScaleModes.NEAREST`. - * - * @method Phaser.GameObjects.Components.ScaleMode#setScaleMode - * @since 3.0.0 - * - * @param {Phaser.ScaleModes} value - The Scale Mode to be used by this Game Object. - * - * @return {this} This Game Object instance. - */ - setScaleMode: function (value) - { - this.scaleMode = value; - - return this; - } - -}; - -module.exports = ScaleMode; diff --git a/src/gameobjects/components/index.js b/src/gameobjects/components/index.js index 7885145ff4..c7cbf21589 100644 --- a/src/gameobjects/components/index.js +++ b/src/gameobjects/components/index.js @@ -21,7 +21,6 @@ module.exports = { Mask: require('./Mask'), Origin: require('./Origin'), Pipeline: require('./Pipeline'), - ScaleMode: require('./ScaleMode'), ScrollFactor: require('./ScrollFactor'), Size: require('./Size'), Texture: require('./Texture'), diff --git a/src/gameobjects/extern/Extern.js b/src/gameobjects/extern/Extern.js index 57f1e9661a..7b9bcb9fa3 100644 --- a/src/gameobjects/extern/Extern.js +++ b/src/gameobjects/extern/Extern.js @@ -38,7 +38,6 @@ var ExternRender = require('./ExternRender'); * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Flip * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Size * @extends Phaser.GameObjects.Components.Texture @@ -58,7 +57,6 @@ var Extern = new Class({ Components.Depth, Components.Flip, Components.Origin, - Components.ScaleMode, Components.ScrollFactor, Components.Size, Components.Texture, diff --git a/src/gameobjects/image/Image.js b/src/gameobjects/image/Image.js index a2c45c3e2f..f2d22c1092 100644 --- a/src/gameobjects/image/Image.js +++ b/src/gameobjects/image/Image.js @@ -32,7 +32,6 @@ var ImageRender = require('./ImageRender'); * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Size * @extends Phaser.GameObjects.Components.TextureCrop @@ -59,7 +58,6 @@ var Image = new Class({ Components.Mask, Components.Origin, Components.Pipeline, - Components.ScaleMode, Components.ScrollFactor, Components.Size, Components.TextureCrop, diff --git a/src/gameobjects/mesh/Mesh.js b/src/gameobjects/mesh/Mesh.js index 4395732ba2..1598caf9f4 100644 --- a/src/gameobjects/mesh/Mesh.js +++ b/src/gameobjects/mesh/Mesh.js @@ -26,7 +26,6 @@ var NOOP = require('../../utils/NOOP'); * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.Size * @extends Phaser.GameObjects.Components.Texture * @extends Phaser.GameObjects.Components.Transform @@ -53,7 +52,6 @@ var Mesh = new Class({ Components.GetBounds, Components.Mask, Components.Pipeline, - Components.ScaleMode, Components.Size, Components.Texture, Components.Transform, diff --git a/src/gameobjects/rendertexture/RenderTexture.js b/src/gameobjects/rendertexture/RenderTexture.js index 5b245b52db..8f16608b36 100644 --- a/src/gameobjects/rendertexture/RenderTexture.js +++ b/src/gameobjects/rendertexture/RenderTexture.js @@ -44,7 +44,6 @@ var UUID = require('../../utils/string/UUID'); * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Tint * @extends Phaser.GameObjects.Components.Transform @@ -71,7 +70,6 @@ var RenderTexture = new Class({ Components.Mask, Components.Origin, Components.Pipeline, - Components.ScaleMode, Components.ScrollFactor, Components.Tint, Components.Transform, diff --git a/src/gameobjects/shape/Shape.js b/src/gameobjects/shape/Shape.js index 657767fb93..541be1b3ca 100644 --- a/src/gameobjects/shape/Shape.js +++ b/src/gameobjects/shape/Shape.js @@ -28,7 +28,6 @@ var Line = require('../../geom/line/Line'); * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible @@ -50,7 +49,6 @@ var Shape = new Class({ Components.Mask, Components.Origin, Components.Pipeline, - Components.ScaleMode, Components.ScrollFactor, Components.Transform, Components.Visible diff --git a/src/gameobjects/sprite/Sprite.js b/src/gameobjects/sprite/Sprite.js index 7193b04a4d..61e5b79a48 100644 --- a/src/gameobjects/sprite/Sprite.js +++ b/src/gameobjects/sprite/Sprite.js @@ -35,7 +35,6 @@ var SpriteRender = require('./SpriteRender'); * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Size * @extends Phaser.GameObjects.Components.TextureCrop @@ -62,7 +61,6 @@ var Sprite = new Class({ Components.Mask, Components.Origin, Components.Pipeline, - Components.ScaleMode, Components.ScrollFactor, Components.Size, Components.TextureCrop, diff --git a/src/gameobjects/text/static/Text.js b/src/gameobjects/text/static/Text.js index 7762f2857c..26cccc82e1 100644 --- a/src/gameobjects/text/static/Text.js +++ b/src/gameobjects/text/static/Text.js @@ -72,7 +72,6 @@ var TextStyle = require('../TextStyle'); * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Tint * @extends Phaser.GameObjects.Components.Transform @@ -99,7 +98,6 @@ var Text = new Class({ Components.Mask, Components.Origin, Components.Pipeline, - Components.ScaleMode, Components.ScrollFactor, Components.Tint, Components.Transform, diff --git a/src/gameobjects/tilesprite/TileSprite.js b/src/gameobjects/tilesprite/TileSprite.js index 3db5ca47c7..b984c22b52 100644 --- a/src/gameobjects/tilesprite/TileSprite.js +++ b/src/gameobjects/tilesprite/TileSprite.js @@ -56,7 +56,6 @@ var _FLAG = 8; // 1000 * @extends Phaser.GameObjects.Components.Mask * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Tint * @extends Phaser.GameObjects.Components.Transform @@ -85,7 +84,6 @@ var TileSprite = new Class({ Components.Mask, Components.Origin, Components.Pipeline, - Components.ScaleMode, Components.ScrollFactor, Components.Tint, Components.Transform, diff --git a/src/gameobjects/zone/Zone.js b/src/gameobjects/zone/Zone.js index 4c71ccd029..3d4d670a34 100644 --- a/src/gameobjects/zone/Zone.js +++ b/src/gameobjects/zone/Zone.js @@ -36,7 +36,6 @@ var RectangleContains = require('../../geom/rectangle/Contains'); * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Visible @@ -55,7 +54,6 @@ var Zone = new Class({ Components.Depth, Components.GetBounds, Components.Origin, - Components.ScaleMode, Components.Transform, Components.ScrollFactor, Components.Visible diff --git a/src/physics/arcade/ArcadeImage.js b/src/physics/arcade/ArcadeImage.js index 0721e41b96..88652657b6 100644 --- a/src/physics/arcade/ArcadeImage.js +++ b/src/physics/arcade/ArcadeImage.js @@ -40,7 +40,6 @@ var Image = require('../../gameobjects/image/Image'); * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Size * @extends Phaser.GameObjects.Components.Texture diff --git a/src/physics/arcade/ArcadeSprite.js b/src/physics/arcade/ArcadeSprite.js index 870f547739..20cbd36c87 100644 --- a/src/physics/arcade/ArcadeSprite.js +++ b/src/physics/arcade/ArcadeSprite.js @@ -41,7 +41,6 @@ var Sprite = require('../../gameobjects/sprite/Sprite'); * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Size * @extends Phaser.GameObjects.Components.Texture diff --git a/src/physics/impact/ImpactImage.js b/src/physics/impact/ImpactImage.js index 83b15b0fcf..f7bace54b7 100644 --- a/src/physics/impact/ImpactImage.js +++ b/src/physics/impact/ImpactImage.js @@ -42,7 +42,6 @@ var Image = require('../../gameobjects/image/Image'); * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Size * @extends Phaser.GameObjects.Components.Texture diff --git a/src/physics/impact/ImpactSprite.js b/src/physics/impact/ImpactSprite.js index cb0d0aec9b..28be976b70 100644 --- a/src/physics/impact/ImpactSprite.js +++ b/src/physics/impact/ImpactSprite.js @@ -45,7 +45,6 @@ var Sprite = require('../../gameobjects/sprite/Sprite'); * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Size * @extends Phaser.GameObjects.Components.Texture diff --git a/src/physics/matter-js/MatterImage.js b/src/physics/matter-js/MatterImage.js index ba7b1ea5d3..95ba68a8e5 100644 --- a/src/physics/matter-js/MatterImage.js +++ b/src/physics/matter-js/MatterImage.js @@ -46,7 +46,6 @@ var Vector2 = require('../../math/Vector2'); * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Size * @extends Phaser.GameObjects.Components.Texture diff --git a/src/physics/matter-js/MatterSprite.js b/src/physics/matter-js/MatterSprite.js index 342f400491..3da14a523d 100644 --- a/src/physics/matter-js/MatterSprite.js +++ b/src/physics/matter-js/MatterSprite.js @@ -50,7 +50,6 @@ var Vector2 = require('../../math/Vector2'); * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Size * @extends Phaser.GameObjects.Components.Texture diff --git a/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js b/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js index 996b431b39..68faf47c54 100644 --- a/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js +++ b/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js @@ -35,7 +35,6 @@ var TilemapComponents = require('../components'); * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible diff --git a/src/tilemaps/staticlayer/StaticTilemapLayer.js b/src/tilemaps/staticlayer/StaticTilemapLayer.js index 18c7ed50a4..bff11a593f 100644 --- a/src/tilemaps/staticlayer/StaticTilemapLayer.js +++ b/src/tilemaps/staticlayer/StaticTilemapLayer.js @@ -37,7 +37,6 @@ var Utils = require('../../renderer/webgl/Utils'); * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScaleMode * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * @extends Phaser.GameObjects.Components.ScrollFactor