Skip to content

Commit 102c74e

Browse files
committed
Deprecated the following:
* Camera.screenView * ScaleManager.maxIterations * ScaleManager.enterPortrait (see onOrientationChange) * ScaleManager.enterLandscape (see onOrientationChange) * ScaleManager.enterFullScreen (see onFullScreenChange) * ScaleManager.leaveFullScreen (see onFullScreenChange) * ScaleManager.fullScreenFailed (see onFullScreenError) * ScaleManager.checkResize * ScaleManager.checkOrientation * ScaleManager.setScreenSize (see updateLayout) * ScaleManager.setSize (see reflowCanvas) * ScaleManager.checkOrientationState (see reflowCanvas) * ScaleManager.orientation (see screenOrientation) * Gamepad.disabled (see enabled) * Input.currentPointers (see totalActivePointers) * Input.disabled (see enabled) * Keyboard.disabled (see enabled) * Mouse.disabled (see enabled) * Mouse.mouseMoveCallback (see Input.addMoveCallback) * MSPointer.disabled (see enabled) * Touch.disabled (see enabled) * Cache.getUrl (see getURL) * Math.truncate (see Math.trunc) * Math.snapToInArray (see Phaser.ArrayUtils.findClosest) * Math.interpolateFloat (see Math.linear) * Math.normalizeLatitude (use Phaser.Math.clamp(lat, -90, 90)) * Math.normalizeLongitude (use Phaser.Math.wrap(lng, -180, 180)) * Math.chanceRoll (use Phaser.Utils.chanceRoll) * Math.numberArray (use Phaser.ArrayUtils.numberArray) * Math.numberArrayStep (use Phaser.ArrayUtils.numberArrayStep) * Math.limitValue (use Phaser.Math.clamp) * Math.randomSign (use Phaser.Utils.randomChoice(-1, 1)) * Math.angleLimit (use Phaser.Math.clamp) * Math.getRandom (use Phaser.ArrayUtils.getRandomItem) * Math.removeRandom (use Phaser.ArrayUtils.removeRandomItem) * Math.floor (use Math.trunc) * Math.ceil (use Phaser.Math.roundAwayFromZero) * Math.shift (use Phaser.ArrayUtils.rotate) * Math.shuffleArray (use Phaser.ArrayUtils.shuffle) * Math.distanceRounded (do the rounding locally) * Canvas.getOffset (see Phaser.DOM.getOffset) * Canvas.getAspectRatio (see Phaser.DOM.getAspectRatio) * TilemapLayer.tileColor (use TilemapLayer.debugSettings.missingImageFill) * Phaser.ArrayList alias removed, now use Phaser.ArraySet * Utils.transposeArray (see Phaser.ArrayUtils.transposeMatrix) * Utils.rotateArray (see Phaser.ArrayUtils.rotateMatrix) * Utils.shuffle (see Phaser.ArrayUtils.shuffle)
1 parent 8cf28fe commit 102c74e

17 files changed

Lines changed: 68 additions & 681 deletions

File tree

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,59 @@ Version 2.4 - "Katar" - in dev
402402
* Due to a Pixi 2 issue TileSprite when running under WebGL didn't respect the world alpha setting and would only work with its own alpha (thanks @hanenbro #1774)
403403
* TileSprite now fully supports animation again, having been broken for several versions due to a Pixi upgrade. We've updated the way TileSprites generate their textures internally considerably and animation support is back across both Canvas and WebGL as a result (#1653)
404404

405+
### Deprecated
406+
407+
All of the following have been removed from Phaser 2.4.
408+
They were flagged as deprecated in Phaser 2.2 or earlier.
409+
410+
* Camera.screenView
411+
* ScaleManager.maxIterations
412+
* ScaleManager.enterPortrait (see onOrientationChange)
413+
* ScaleManager.enterLandscape (see onOrientationChange)
414+
* ScaleManager.enterFullScreen (see onFullScreenChange)
415+
* ScaleManager.leaveFullScreen (see onFullScreenChange)
416+
* ScaleManager.fullScreenFailed (see onFullScreenError)
417+
* ScaleManager.checkResize
418+
* ScaleManager.checkOrientation
419+
* ScaleManager.setScreenSize (see updateLayout)
420+
* ScaleManager.setSize (see reflowCanvas)
421+
* ScaleManager.checkOrientationState (see reflowCanvas)
422+
* ScaleManager.orientation (see screenOrientation)
423+
* Gamepad.disabled (see enabled)
424+
* Input.currentPointers (see totalActivePointers)
425+
* Input.disabled (see enabled)
426+
* Keyboard.disabled (see enabled)
427+
* Mouse.disabled (see enabled)
428+
* Mouse.mouseMoveCallback (see Input.addMoveCallback)
429+
* MSPointer.disabled (see enabled)
430+
* Touch.disabled (see enabled)
431+
* Cache.getUrl (see getURL)
432+
* Math.truncate (see Math.trunc)
433+
* Math.snapToInArray (see Phaser.ArrayUtils.findClosest)
434+
* Math.interpolateFloat (see Math.linear)
435+
* Math.normalizeLatitude (use Phaser.Math.clamp(lat, -90, 90))
436+
* Math.normalizeLongitude (use Phaser.Math.wrap(lng, -180, 180))
437+
* Math.chanceRoll (use Phaser.Utils.chanceRoll)
438+
* Math.numberArray (use Phaser.ArrayUtils.numberArray)
439+
* Math.numberArrayStep (use Phaser.ArrayUtils.numberArrayStep)
440+
* Math.limitValue (use Phaser.Math.clamp)
441+
* Math.randomSign (use Phaser.Utils.randomChoice(-1, 1))
442+
* Math.angleLimit (use Phaser.Math.clamp)
443+
* Math.getRandom (use Phaser.ArrayUtils.getRandomItem)
444+
* Math.removeRandom (use Phaser.ArrayUtils.removeRandomItem)
445+
* Math.floor (use Math.trunc)
446+
* Math.ceil (use Phaser.Math.roundAwayFromZero)
447+
* Math.shift (use Phaser.ArrayUtils.rotate)
448+
* Math.shuffleArray (use Phaser.ArrayUtils.shuffle)
449+
* Math.distanceRounded (do the rounding locally)
450+
* Canvas.getOffset (see Phaser.DOM.getOffset)
451+
* Canvas.getAspectRatio (see Phaser.DOM.getAspectRatio)
452+
* TilemapLayer.tileColor (use TilemapLayer.debugSettings.missingImageFill)
453+
* Phaser.ArrayList alias removed, now use Phaser.ArraySet
454+
* Utils.transposeArray (see Phaser.ArrayUtils.transposeMatrix)
455+
* Utils.rotateArray (see Phaser.ArrayUtils.rotateMatrix)
456+
* Utils.shuffle (see Phaser.ArrayUtils.shuffle)
457+
405458
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
406459

407460
![div](http://www.phaser.io/images/github/div.png)

src/core/Camera.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ Phaser.Camera = function (game, id, x, y, width, height) {
4444
*/
4545
this.view = new Phaser.Rectangle(x, y, width, height);
4646

47-
/**
48-
* @property {Phaser.Rectangle} screenView - Used by Sprites to work out Camera culling.
49-
* @deprecated No longer used for camera culling. Uses Camera.view instead.
50-
*/
51-
this.screenView = new Phaser.Rectangle(x, y, width, height);
52-
5347
/**
5448
* The Camera is bound to this Rectangle and cannot move outside of it. By default it is enabled and set to the size of the World.
5549
* The Rectangle can be located anywhere in the world and updated as often as you like. If you don't wish the Camera to be bound

src/core/ScaleManager.js

Lines changed: 0 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,6 @@ Phaser.ScaleManager = function (game, width, height) {
174174
*/
175175
this._pageAlignVertically = false;
176176

177-
/**
178-
* The maximum number of times a canvas will be resized (in a row) in order to fill the browser.
179-
* @property {number} maxIterations
180-
* @protected
181-
* @see {@link Phaser.ScaleManger#refresh refresh}
182-
* @deprecated 2.2.0 - This is not used anymore as reflow iterations are "automatic".
183-
*/
184-
this.maxIterations = 5;
185-
186177
/**
187178
* This signal is dispatched when the orientation changes _or_ the validity of the current orientation changes.
188179
*
@@ -209,28 +200,6 @@ Phaser.ScaleManager = function (game, width, height) {
209200
*/
210201
this.onOrientationChange = new Phaser.Signal();
211202

212-
/**
213-
* This signal is dispatched when the browser enters landscape orientation, having been in portrait.
214-
*
215-
* This is signaled from `preUpdate` (or `pauseUpdate`) _even when_ the game is paused.
216-
*
217-
* @property {Phaser.Signal} enterLandscape
218-
* @public
219-
* @deprecated 2.2.0 - Use {@link Phaser.ScaleManager#onOrientationChange onOrientationChange}
220-
*/
221-
this.enterLandscape = new Phaser.Signal();
222-
223-
/**
224-
* This signal is dispatched when the browser enters portrait orientation, having been in landscape.
225-
*
226-
* This is signaled from `preUpdate` (or `pauseUpdate`) _even when_ the game is paused.
227-
*
228-
* @property {Phaser.Signal} enterPortrait
229-
* @public
230-
* @deprecated 2.2.0 - Use {@link Phaser.ScaleManager#onOrientationChange onOrientationChange}
231-
*/
232-
this.enterPortrait = new Phaser.Signal();
233-
234203
/**
235204
* This signal is dispatched when the browser enters an incorrect orientation, as defined by {@link #forceOrientation}.
236205
*
@@ -319,34 +288,6 @@ Phaser.ScaleManager = function (game, width, height) {
319288
*/
320289
this.onFullScreenError = new Phaser.Signal();
321290

322-
/**
323-
* This signal is dispatched when the browser enters fullscreen mode, if supported.
324-
*
325-
* @property {Phaser.Signal} enterFullScreen
326-
* @public
327-
* @deprecated 2.2.0 - Use {@link Phaser.ScaleManager#onFullScreenChange onFullScreenChange}
328-
*/
329-
this.enterFullScreen = new Phaser.Signal();
330-
331-
/**
332-
* This signal is dispatched when the browser leaves fullscreen mode.
333-
*
334-
* @property {Phaser.Signal} leaveFullScreen
335-
* @public
336-
* @deprecated 2.2.0 - Use {@link Phaser.ScaleManager#onFullScreenChange onFullScreenChange}
337-
*/
338-
this.leaveFullScreen = new Phaser.Signal();
339-
340-
/**
341-
* This signal is dispatched when the browser fails to enter fullscreen mode;
342-
* or if the device does not support fullscreen mode and {@link #startFullScreen} is invoked.
343-
*
344-
* @property {Phaser.Signal} fullScreenFailed
345-
* @public
346-
* @deprecated 2.2.0 - Use {@link Phaser.ScaleManager#onFullScreenError onFullScreenError}
347-
*/
348-
this.fullScreenFailed = this.onFullScreenError;
349-
350291
/**
351292
* The _last known_ orientation of the screen, as defined in the Window Screen Web API.
352293
* See {@link Phaser.DOM.getScreenOrientation} for possible values.
@@ -2109,76 +2050,6 @@ Phaser.ScaleManager.prototype = {
21092050

21102051
Phaser.ScaleManager.prototype.constructor = Phaser.ScaleManager;
21112052

2112-
/**
2113-
* window.resize event handler.
2114-
* @method checkResize
2115-
* @memberof Phaser.ScaleManager
2116-
* @protected
2117-
* @deprecated 2.2.0 - This method is INTERNAL: avoid using it directly.
2118-
*/
2119-
Phaser.ScaleManager.prototype.checkResize = Phaser.ScaleManager.prototype.windowResize;
2120-
2121-
/**
2122-
* window.orientationchange event handler.
2123-
* @method checkOrientation
2124-
* @memberof Phaser.ScaleManager
2125-
* @protected
2126-
* @deprecated 2.2.0 - This method is INTERNAL: avoid using it directly.
2127-
*/
2128-
Phaser.ScaleManager.prototype.checkOrientation = Phaser.ScaleManager.prototype.orientationChange;
2129-
2130-
/**
2131-
* Updates the size of the Game or the size/position of the Display canvas based on internal state.
2132-
*
2133-
* Do not call this directly. To "refresh" the layout use {@link Phaser.ScaleManager#refresh refresh}.
2134-
* To precisely control the scaling/size, apply appropriate rules to the bounding Parent container or
2135-
* use the {@link Phaser.ScaleManager#scaleMode USER_SCALE scale mode}.
2136-
*
2137-
* @method Phaser.ScaleManager#setScreenSize
2138-
* @protected
2139-
* @deprecated 2.2.0 - This method is INTERNAL: avoid using it directly.
2140-
*/
2141-
Phaser.ScaleManager.prototype.setScreenSize = Phaser.ScaleManager.prototype.updateLayout;
2142-
2143-
/**
2144-
* Updates the size/position of the Display canvas based on internal state.
2145-
*
2146-
* Do not call this directly. To "refresh" the layout use {@link Phaser.ScaleManager#refresh refresh}.
2147-
* To precisely control the scaling/size, apply appropriate rules to the bounding Parent container or
2148-
* use the {@link Phaser.ScaleManager#scaleMode USER_SCALE scale mode}.
2149-
*
2150-
* @method setSize
2151-
* @memberof Phaser.ScaleManager
2152-
* @protected
2153-
* @deprecated 2.2.0 - This method is INTERNAL: avoid using it directly.
2154-
*/
2155-
Phaser.ScaleManager.prototype.setSize = Phaser.ScaleManager.prototype.reflowCanvas;
2156-
2157-
/**
2158-
* Checks if the browser is in the correct orientation for the game,
2159-
* dependent upon {@link #forceLandscape} and {@link #forcePortrait}, and updates the state.
2160-
*
2161-
* The appropriate event is dispatched if the orientation became valid or invalid.
2162-
*
2163-
* @method checkOrientationState
2164-
* @memberof Phaser.ScaleManager
2165-
* @protected
2166-
* @return {boolean} True if the orientation state changed (consider a refresh)
2167-
* @deprecated 2.2.0 - This is only for backward compatibility of user code.
2168-
*/
2169-
Phaser.ScaleManager.prototype.checkOrientationState = function () {
2170-
2171-
var changed = this.updateOrientationState();
2172-
2173-
if (changed)
2174-
{
2175-
this.refresh();
2176-
}
2177-
2178-
return changed;
2179-
2180-
};
2181-
21822053
/**
21832054
* The DOM element that is considered the Parent bounding element, if any.
21842055
*
@@ -2447,21 +2318,6 @@ Object.defineProperty(Phaser.ScaleManager.prototype, "isLandscape", {
24472318

24482319
});
24492320

2450-
/**
2451-
* The _last known_ orientation value of the screen. A value of 90 is landscape and 0 is portrait.
2452-
* @name Phaser.ScaleManager#orientation
2453-
* @property {integer} orientation
2454-
* @readonly
2455-
* @deprecated 2.2.0 - Use {@link #screenOrientation} instead.
2456-
*/
2457-
Object.defineProperty(Phaser.ScaleManager.prototype, "orientation", {
2458-
2459-
get: function () {
2460-
return (this.classifyOrientation(this.screenOrientation) === 'portrait' ? 0 : 90);
2461-
}
2462-
2463-
});
2464-
24652321
/**
24662322
* Returns true if the game dimensions are portrait (height > width).
24672323
* This is especially useful to check when using the RESIZE scale mode

src/gameobjects/Button.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,63 +86,55 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
8686
/**
8787
* The Sound to be played when this Buttons Over state is activated.
8888
* @property {Phaser.Sound|Phaser.AudioSprite|null} onOverSound
89-
* @deprecated
9089
* @readonly
9190
*/
9291
this.onOverSound = null;
9392

9493
/**
9594
* The Sound to be played when this Buttons Out state is activated.
9695
* @property {Phaser.Sound|Phaser.AudioSprite|null} onOutSound
97-
* @deprecated
9896
* @readonly
9997
*/
10098
this.onOutSound = null;
10199

102100
/**
103101
* The Sound to be played when this Buttons Down state is activated.
104102
* @property {Phaser.Sound|Phaser.AudioSprite|null} onDownSound
105-
* @deprecated
106103
* @readonly
107104
*/
108105
this.onDownSound = null;
109106

110107
/**
111108
* The Sound to be played when this Buttons Up state is activated.
112109
* @property {Phaser.Sound|Phaser.AudioSprite|null} onUpSound
113-
* @deprecated
114110
* @readonly
115111
*/
116112
this.onUpSound = null;
117113

118114
/**
119115
* The Sound Marker used in conjunction with the onOverSound.
120116
* @property {string} onOverSoundMarker
121-
* @deprecated
122117
* @readonly
123118
*/
124119
this.onOverSoundMarker = '';
125120

126121
/**
127122
* The Sound Marker used in conjunction with the onOutSound.
128123
* @property {string} onOutSoundMarker
129-
* @deprecated
130124
* @readonly
131125
*/
132126
this.onOutSoundMarker = '';
133127

134128
/**
135129
* The Sound Marker used in conjunction with the onDownSound.
136130
* @property {string} onDownSoundMarker
137-
* @deprecated
138131
* @readonly
139132
*/
140133
this.onDownSoundMarker = '';
141134

142135
/**
143136
* The Sound Marker used in conjunction with the onUpSound.
144137
* @property {string} onUpSoundMarker
145-
* @deprecated
146138
* @readonly
147139
*/
148140
this.onUpSoundMarker = '';

src/input/Gamepad.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -483,24 +483,6 @@ Phaser.Gamepad.prototype = {
483483

484484
Phaser.Gamepad.prototype.constructor = Phaser.Gamepad;
485485

486-
/**
487-
* If disabled all Gamepad input will be ignored.
488-
* @property {boolean} disabled
489-
* @memberof Phaser.Gamepad
490-
* @default false
491-
* @deprecated Use {@link Phaser.Gamepad#enabled} instead
492-
*/
493-
Object.defineProperty(Phaser.Gamepad.prototype, "disabled", {
494-
495-
get: function () {
496-
return !this.enabled;
497-
},
498-
set: function (value) {
499-
this.enabled = !value;
500-
}
501-
502-
});
503-
504486
/**
505487
* If the gamepad input is active or not - if not active it should not be updated from Input.js
506488
* @name Phaser.Gamepad#active

0 commit comments

Comments
 (0)