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)
This commit is contained in:
photonstorm 2015-06-17 03:14:31 +01:00
parent 8cf28fede7
commit 102c74e121
17 changed files with 68 additions and 681 deletions

View file

@ -402,6 +402,59 @@ Version 2.4 - "Katar" - in dev
* 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)
* 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)
### Deprecated
All of the following have been removed from Phaser 2.4.
They were flagged as deprecated in Phaser 2.2 or earlier.
* 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)
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
![div](http://www.phaser.io/images/github/div.png)

View file

@ -44,12 +44,6 @@ Phaser.Camera = function (game, id, x, y, width, height) {
*/
this.view = new Phaser.Rectangle(x, y, width, height);
/**
* @property {Phaser.Rectangle} screenView - Used by Sprites to work out Camera culling.
* @deprecated No longer used for camera culling. Uses Camera.view instead.
*/
this.screenView = new Phaser.Rectangle(x, y, width, height);
/**
* 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.
* 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

View file

@ -174,15 +174,6 @@ Phaser.ScaleManager = function (game, width, height) {
*/
this._pageAlignVertically = false;
/**
* The maximum number of times a canvas will be resized (in a row) in order to fill the browser.
* @property {number} maxIterations
* @protected
* @see {@link Phaser.ScaleManger#refresh refresh}
* @deprecated 2.2.0 - This is not used anymore as reflow iterations are "automatic".
*/
this.maxIterations = 5;
/**
* This signal is dispatched when the orientation changes _or_ the validity of the current orientation changes.
*
@ -209,28 +200,6 @@ Phaser.ScaleManager = function (game, width, height) {
*/
this.onOrientationChange = new Phaser.Signal();
/**
* This signal is dispatched when the browser enters landscape orientation, having been in portrait.
*
* This is signaled from `preUpdate` (or `pauseUpdate`) _even when_ the game is paused.
*
* @property {Phaser.Signal} enterLandscape
* @public
* @deprecated 2.2.0 - Use {@link Phaser.ScaleManager#onOrientationChange onOrientationChange}
*/
this.enterLandscape = new Phaser.Signal();
/**
* This signal is dispatched when the browser enters portrait orientation, having been in landscape.
*
* This is signaled from `preUpdate` (or `pauseUpdate`) _even when_ the game is paused.
*
* @property {Phaser.Signal} enterPortrait
* @public
* @deprecated 2.2.0 - Use {@link Phaser.ScaleManager#onOrientationChange onOrientationChange}
*/
this.enterPortrait = new Phaser.Signal();
/**
* This signal is dispatched when the browser enters an incorrect orientation, as defined by {@link #forceOrientation}.
*
@ -319,34 +288,6 @@ Phaser.ScaleManager = function (game, width, height) {
*/
this.onFullScreenError = new Phaser.Signal();
/**
* This signal is dispatched when the browser enters fullscreen mode, if supported.
*
* @property {Phaser.Signal} enterFullScreen
* @public
* @deprecated 2.2.0 - Use {@link Phaser.ScaleManager#onFullScreenChange onFullScreenChange}
*/
this.enterFullScreen = new Phaser.Signal();
/**
* This signal is dispatched when the browser leaves fullscreen mode.
*
* @property {Phaser.Signal} leaveFullScreen
* @public
* @deprecated 2.2.0 - Use {@link Phaser.ScaleManager#onFullScreenChange onFullScreenChange}
*/
this.leaveFullScreen = new Phaser.Signal();
/**
* This signal is dispatched when the browser fails to enter fullscreen mode;
* or if the device does not support fullscreen mode and {@link #startFullScreen} is invoked.
*
* @property {Phaser.Signal} fullScreenFailed
* @public
* @deprecated 2.2.0 - Use {@link Phaser.ScaleManager#onFullScreenError onFullScreenError}
*/
this.fullScreenFailed = this.onFullScreenError;
/**
* The _last known_ orientation of the screen, as defined in the Window Screen Web API.
* See {@link Phaser.DOM.getScreenOrientation} for possible values.
@ -2109,76 +2050,6 @@ Phaser.ScaleManager.prototype = {
Phaser.ScaleManager.prototype.constructor = Phaser.ScaleManager;
/**
* window.resize event handler.
* @method checkResize
* @memberof Phaser.ScaleManager
* @protected
* @deprecated 2.2.0 - This method is INTERNAL: avoid using it directly.
*/
Phaser.ScaleManager.prototype.checkResize = Phaser.ScaleManager.prototype.windowResize;
/**
* window.orientationchange event handler.
* @method checkOrientation
* @memberof Phaser.ScaleManager
* @protected
* @deprecated 2.2.0 - This method is INTERNAL: avoid using it directly.
*/
Phaser.ScaleManager.prototype.checkOrientation = Phaser.ScaleManager.prototype.orientationChange;
/**
* Updates the size of the Game or the size/position of the Display canvas based on internal state.
*
* Do not call this directly. To "refresh" the layout use {@link Phaser.ScaleManager#refresh refresh}.
* To precisely control the scaling/size, apply appropriate rules to the bounding Parent container or
* use the {@link Phaser.ScaleManager#scaleMode USER_SCALE scale mode}.
*
* @method Phaser.ScaleManager#setScreenSize
* @protected
* @deprecated 2.2.0 - This method is INTERNAL: avoid using it directly.
*/
Phaser.ScaleManager.prototype.setScreenSize = Phaser.ScaleManager.prototype.updateLayout;
/**
* Updates the size/position of the Display canvas based on internal state.
*
* Do not call this directly. To "refresh" the layout use {@link Phaser.ScaleManager#refresh refresh}.
* To precisely control the scaling/size, apply appropriate rules to the bounding Parent container or
* use the {@link Phaser.ScaleManager#scaleMode USER_SCALE scale mode}.
*
* @method setSize
* @memberof Phaser.ScaleManager
* @protected
* @deprecated 2.2.0 - This method is INTERNAL: avoid using it directly.
*/
Phaser.ScaleManager.prototype.setSize = Phaser.ScaleManager.prototype.reflowCanvas;
/**
* Checks if the browser is in the correct orientation for the game,
* dependent upon {@link #forceLandscape} and {@link #forcePortrait}, and updates the state.
*
* The appropriate event is dispatched if the orientation became valid or invalid.
*
* @method checkOrientationState
* @memberof Phaser.ScaleManager
* @protected
* @return {boolean} True if the orientation state changed (consider a refresh)
* @deprecated 2.2.0 - This is only for backward compatibility of user code.
*/
Phaser.ScaleManager.prototype.checkOrientationState = function () {
var changed = this.updateOrientationState();
if (changed)
{
this.refresh();
}
return changed;
};
/**
* The DOM element that is considered the Parent bounding element, if any.
*
@ -2447,21 +2318,6 @@ Object.defineProperty(Phaser.ScaleManager.prototype, "isLandscape", {
});
/**
* The _last known_ orientation value of the screen. A value of 90 is landscape and 0 is portrait.
* @name Phaser.ScaleManager#orientation
* @property {integer} orientation
* @readonly
* @deprecated 2.2.0 - Use {@link #screenOrientation} instead.
*/
Object.defineProperty(Phaser.ScaleManager.prototype, "orientation", {
get: function () {
return (this.classifyOrientation(this.screenOrientation) === 'portrait' ? 0 : 90);
}
});
/**
* Returns true if the game dimensions are portrait (height > width).
* This is especially useful to check when using the RESIZE scale mode

View file

@ -86,7 +86,6 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
/**
* The Sound to be played when this Buttons Over state is activated.
* @property {Phaser.Sound|Phaser.AudioSprite|null} onOverSound
* @deprecated
* @readonly
*/
this.onOverSound = null;
@ -94,7 +93,6 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
/**
* The Sound to be played when this Buttons Out state is activated.
* @property {Phaser.Sound|Phaser.AudioSprite|null} onOutSound
* @deprecated
* @readonly
*/
this.onOutSound = null;
@ -102,7 +100,6 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
/**
* The Sound to be played when this Buttons Down state is activated.
* @property {Phaser.Sound|Phaser.AudioSprite|null} onDownSound
* @deprecated
* @readonly
*/
this.onDownSound = null;
@ -110,7 +107,6 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
/**
* The Sound to be played when this Buttons Up state is activated.
* @property {Phaser.Sound|Phaser.AudioSprite|null} onUpSound
* @deprecated
* @readonly
*/
this.onUpSound = null;
@ -118,7 +114,6 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
/**
* The Sound Marker used in conjunction with the onOverSound.
* @property {string} onOverSoundMarker
* @deprecated
* @readonly
*/
this.onOverSoundMarker = '';
@ -126,7 +121,6 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
/**
* The Sound Marker used in conjunction with the onOutSound.
* @property {string} onOutSoundMarker
* @deprecated
* @readonly
*/
this.onOutSoundMarker = '';
@ -134,7 +128,6 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
/**
* The Sound Marker used in conjunction with the onDownSound.
* @property {string} onDownSoundMarker
* @deprecated
* @readonly
*/
this.onDownSoundMarker = '';
@ -142,7 +135,6 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
/**
* The Sound Marker used in conjunction with the onUpSound.
* @property {string} onUpSoundMarker
* @deprecated
* @readonly
*/
this.onUpSoundMarker = '';

View file

@ -483,24 +483,6 @@ Phaser.Gamepad.prototype = {
Phaser.Gamepad.prototype.constructor = Phaser.Gamepad;
/**
* If disabled all Gamepad input will be ignored.
* @property {boolean} disabled
* @memberof Phaser.Gamepad
* @default false
* @deprecated Use {@link Phaser.Gamepad#enabled} instead
*/
Object.defineProperty(Phaser.Gamepad.prototype, "disabled", {
get: function () {
return !this.enabled;
},
set: function (value) {
this.enabled = !value;
}
});
/**
* If the gamepad input is active or not - if not active it should not be updated from Input.js
* @name Phaser.Gamepad#active

View file

@ -89,12 +89,6 @@ Phaser.Input = function (game) {
*/
this.maxPointers = -1;
/**
* @property {number} currentPointers - The current number of active Pointers.
* @deprecated This is only updated when `maxPointers >= 0` and will generally be innacurate. Use `totalActivePointers` instead.
*/
this.currentPointers = 0;
/**
* @property {number} tapRate - The number of milliseconds that the Pointer has to be pressed down and then released to be considered a tap or click.
* @default
@ -380,7 +374,6 @@ Phaser.Input.prototype = {
this.circle = new Phaser.Circle(0, 0, 44);
this.activePointer = this.mousePointer;
this.currentPointers = 0;
this.hitCanvas = document.createElement('canvas');
this.hitCanvas.width = 1;
@ -578,8 +571,6 @@ Phaser.Input.prototype = {
this.pointers[i].reset();
}
this.currentPointers = 0;
if (this.game.canvas.style.cursor !== 'none')
{
this.game.canvas.style.cursor = 'inherit';
@ -749,9 +740,6 @@ Phaser.Input.prototype = {
}
}
// For backwards compatibility with side-effect in totalActivePointers.
this.currentPointers = (limit - count);
return (limit - count);
},
@ -760,7 +748,7 @@ Phaser.Input.prototype = {
* Get the first Pointer with the given active state.
*
* @method Phaser.Input#getPointer
* @param {boolean} [isActive=false] - The state the Pointer should be in - active or innactive?
* @param {boolean} [isActive=false] - The state the Pointer should be in - active or inactive?
* @return {Phaser.Pointer} A Pointer object or null if no Pointer object matches the requested state.
*/
getPointer: function (isActive) {
@ -1066,22 +1054,3 @@ Object.defineProperty(Phaser.Input.prototype, "worldY", {
}
});
/**
* _All_ input sources (eg. Mouse, Keyboard, Touch) are ignored when Input is disabled.
* To disable just one type of input; for example, the Mouse, use `input.mouse.enabled = false`.
* @property {boolean} disabled
* @memberof Phaser.Input
* @default false
* @deprecated Use {@link Phaser.Input#enabled} instead
*/
Object.defineProperty(Phaser.Input.prototype, "disabled", {
get: function () {
return !this.enabled;
},
set: function (value) {
this.enabled = !value;
}
});

View file

@ -517,24 +517,6 @@ Phaser.Keyboard.prototype = {
};
/**
* If disabled all Keyboard input will be ignored.
* @property {boolean} disabled
* @memberof Phaser.Keyboard
* @default false
* @deprecated Use {@link Phaser.Keyboard#enabled} instead
*/
Object.defineProperty(Phaser.Keyboard.prototype, "disabled", {
get: function () {
return !this.enabled;
},
set: function (value) {
this.enabled = !value;
}
});
/**
* Returns the string value of the most recently pressed key.
* @name Phaser.Keyboard#lastChar

View file

@ -246,21 +246,3 @@ Phaser.MSPointer.prototype = {
};
Phaser.MSPointer.prototype.constructor = Phaser.MSPointer;
/**
* If disabled all MSPointer input will be ignored.
* @property {boolean} disabled
* @memberof Phaser.MSPointer
* @default false
* @deprecated Use {@link Phaser.MSPointer#enabled} instead
*/
Object.defineProperty(Phaser.MSPointer.prototype, "disabled", {
get: function () {
return !this.enabled;
},
set: function (value) {
this.enabled = !value;
}
});

View file

@ -31,12 +31,6 @@ Phaser.Mouse = function (game) {
*/
this.mouseDownCallback = null;
/**
* @property {function} mouseMoveCallback - A callback that can be fired when the mouse is moved.
* @deprecated Will be removed soon. Please use `Input.addMoveCallback` instead.
*/
this.mouseMoveCallback = null;
/**
* @property {function} mouseUpCallback - A callback that can be fired when the mouse is released from a pressed down state.
*/
@ -578,24 +572,6 @@ Phaser.Mouse.prototype = {
Phaser.Mouse.prototype.constructor = Phaser.Mouse;
/**
* If disabled all Mouse input will be ignored.
* @property {boolean} disabled
* @memberof Phaser.Mouse
* @default false
* @deprecated Use {@link Phaser.Mouse#enabled} instead
*/
Object.defineProperty(Phaser.Mouse.prototype, "disabled", {
get: function () {
return !this.enabled;
},
set: function (value) {
this.enabled = !value;
}
});
/* jshint latedef:nofunc */
/**
* A purely internal event support class to proxy 'wheelscroll' and 'DOMMouseWheel'

View file

@ -308,7 +308,9 @@ Phaser.Pointer.prototype = {
// x and y are the old values here?
this.positionDown.setTo(this.x, this.y);
if (this.game.input.multiInputOverride === Phaser.Input.MOUSE_OVERRIDES_TOUCH || this.game.input.multiInputOverride === Phaser.Input.MOUSE_TOUCH_COMBINE || (this.game.input.multiInputOverride === Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.currentPointers === 0))
if (this.game.input.multiInputOverride === Phaser.Input.MOUSE_OVERRIDES_TOUCH ||
this.game.input.multiInputOverride === Phaser.Input.MOUSE_TOUCH_COMBINE ||
(this.game.input.multiInputOverride === Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.totalActivePointers === 0))
{
this.game.input.x = this.x;
this.game.input.y = this.y;
@ -320,11 +322,6 @@ Phaser.Pointer.prototype = {
this._stateReset = false;
this.totalTouches++;
if (!this.isMouse)
{
this.game.input.currentPointers++;
}
if (this.targetObject !== null)
{
this.targetObject._touchedHandler(this);
@ -355,7 +352,9 @@ Phaser.Pointer.prototype = {
if (this._holdSent === false && this.duration >= this.game.input.holdRate)
{
if (this.game.input.multiInputOverride == Phaser.Input.MOUSE_OVERRIDES_TOUCH || this.game.input.multiInputOverride == Phaser.Input.MOUSE_TOUCH_COMBINE || (this.game.input.multiInputOverride == Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.currentPointers === 0))
if (this.game.input.multiInputOverride === Phaser.Input.MOUSE_OVERRIDES_TOUCH ||
this.game.input.multiInputOverride === Phaser.Input.MOUSE_TOUCH_COMBINE ||
(this.game.input.multiInputOverride === Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.totalActivePointers === 0))
{
this.game.input.onHold.dispatch(this);
}
@ -428,7 +427,9 @@ Phaser.Pointer.prototype = {
this.circle.x = this.x;
this.circle.y = this.y;
if (this.game.input.multiInputOverride === Phaser.Input.MOUSE_OVERRIDES_TOUCH || this.game.input.multiInputOverride === Phaser.Input.MOUSE_TOUCH_COMBINE || (this.game.input.multiInputOverride === Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.currentPointers === 0))
if (this.game.input.multiInputOverride === Phaser.Input.MOUSE_OVERRIDES_TOUCH ||
this.game.input.multiInputOverride === Phaser.Input.MOUSE_TOUCH_COMBINE ||
(this.game.input.multiInputOverride === Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.totalActivePointers === 0))
{
this.game.input.activePointer = this;
this.game.input.x = this.x;
@ -609,7 +610,9 @@ Phaser.Pointer.prototype = {
this.timeUp = this.game.time.time;
if (this.game.input.multiInputOverride === Phaser.Input.MOUSE_OVERRIDES_TOUCH || this.game.input.multiInputOverride === Phaser.Input.MOUSE_TOUCH_COMBINE || (this.game.input.multiInputOverride === Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.currentPointers === 0))
if (this.game.input.multiInputOverride === Phaser.Input.MOUSE_OVERRIDES_TOUCH ||
this.game.input.multiInputOverride === Phaser.Input.MOUSE_TOUCH_COMBINE ||
(this.game.input.multiInputOverride === Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.totalActivePointers === 0))
{
this.game.input.onUp.dispatch(this, event);

View file

@ -442,22 +442,3 @@ Phaser.Touch.prototype = {
};
Phaser.Touch.prototype.constructor = Phaser.Touch;
/**
* If disabled all Touch events will be ignored.
* @property {boolean} disabled
* @memberof Phaser.Touch
* @default false
* @deprecated Use {@link Phaser.Touch#enabled} instead
*/
Object.defineProperty(Phaser.Touch.prototype, "disabled", {
get: function () {
return !this.enabled;
},
set: function (value) {
this.enabled = !value;
}
});

View file

@ -1432,23 +1432,6 @@ Phaser.Cache.prototype = {
},
/**
* DEPRECATED: Please use Cache.getURL instead.
* Get a cached object by the URL.
* This only returns a value if you set Cache.autoResolveURL to `true` *before* starting the preload of any assets.
* Be aware that every call to this function makes a DOM src query, so use carefully and double-check for implications in your target browsers/devices.
*
* @method Phaser.Cache#getUrl
* @deprecated Please use Cache.getURL instead.
* @param {string} url - The url for the object loaded to get from the cache.
* @return {object} The cached object.
*/
getUrl: function (url) {
return this.getURL(url);
},
/**
* Gets all keys used by the Cache for the given data type.
*

View file

@ -20,7 +20,6 @@ Phaser.Math = {
* Twice PI.
* @property {number} Phaser.Math#PI2
* @default ~6.283
* @deprecated 2.2.0 - Not used internally. Use `2 * Math.PI` instead.
*/
PI2: Math.PI * 2,
@ -109,16 +108,6 @@ Phaser.Math = {
},
/**
* @method Phaser.Math#truncate
* @param {number} n
* @return {integer}
* @deprecated 2.2.0 - Use `Math.trunc` (now with polyfill)
*/
truncate: function (n) {
return Math.trunc(n);
},
/**
* @method Phaser.Math#shear
* @param {number} n
@ -207,28 +196,6 @@ Phaser.Math = {
},
/**
* Snaps a value to the nearest value in an array.
*
* @method Phaser.Math#snapToInArray
* @param {number} input
* @param {number[]} arr
* @param {boolean} sort - True if the array needs to be sorted.
* @return {number}
* @deprecated 2.2.0 - See {@link Phaser.ArrayUtils.findClosest} for an alternative.
*/
snapToInArray: function (input, arr, sort) {
if (typeof sort === 'undefined') { sort = true; }
if (sort) {
arr.sort();
}
return Phaser.ArrayUtils.findClosest(input, arr);
},
/**
* Round to some place comparative to a `base`, default is 10 for decimal place.
* The `place` is represented by the power applied to `base` to get that place.
@ -311,19 +278,6 @@ Phaser.Math = {
},
/**
* A one dimensional linear interpolation of a value.
* @method Phaser.Math#interpolateFloat
* @param {number} a
* @param {number} b
* @param {number} weight
* @return {number}
* @deprecated 2.2.0 - See {@link Phaser.Math#linear}
*/
interpolateFloat: function (a, b, weight) {
return (b - a) * weight + a;
},
/**
* Find the angle of a segment from (x1, y1) -> (x2, y2).
* @method Phaser.Math#angleBetween
@ -398,76 +352,6 @@ Phaser.Math = {
},
/**
* Normalizes a latitude to the [-90,90] range. Latitudes above 90 or below -90 are capped, not wrapped.
* @method Phaser.Math#normalizeLatitude
* @param {number} lat - The latitude to normalize, in degrees.
* @return {number} Returns the latitude, fit within the [-90,90] range.
* @deprecated 2.2.0 - Use {@link Phaser.Math#clamp}.
*/
normalizeLatitude: function (lat) {
return Phaser.Math.clamp(lat, -90, 90);
},
/**
* Normalizes a longitude to the [-180,180] range. Longitudes above 180 or below -180 are wrapped.
* @method Phaser.Math#normalizeLongitude
* @param {number} lng - The longitude to normalize, in degrees.
* @return {number} Returns the longitude, fit within the [-180,180] range.
* @deprecated 2.2.0 - Use {@link Phaser.Math#wrap}.
*/
normalizeLongitude: function (lng) {
return Phaser.Math.wrap(lng, -180, 180);
},
/**
* Generate a random bool result based on the chance value.
*
* Returns true or false based on the chance value (default 50%). For example if you wanted a player to have a 30% chance
* of getting a bonus, call chanceRoll(30) - true means the chance passed, false means it failed.
*
* @method Phaser.Math#chanceRoll
* @param {number} chance - The chance of receiving the value. A number between 0 and 100 (effectively 0% to 100%).
* @return {boolean} True if the roll passed, or false otherwise.
* @deprecated 2.2.0 - Use {@link Phaser.Utils.chanceRoll}
*/
chanceRoll: function (chance) {
return Phaser.Utils.chanceRoll(chance);
},
/**
* Create an array representing the inclusive range of numbers (usually integers) in `[start, end]`.
*
* @method Phaser.Math#numberArray
* @param {number} start - The minimum value the array starts with.
* @param {number} end - The maximum value the array contains.
* @return {number[]} The array of number values.
* @deprecated 2.2.0 - See {@link Phaser.ArrayUtils.numberArray}
*/
numberArray: function (start, end) {
return Phaser.ArrayUtils.numberArray(start, end);
},
/**
* Create an array of numbers (positive and/or negative) progressing from `start`
* up to but not including `end` by advancing by `step`.
*
* If `start` is less than `stop` a zero-length range is created unless a negative `step` is specified.
*
* Certain values for `start` and `end` (eg. NaN/undefined/null) are coerced to 0;
* for forward compatibility make sure to pass in actual numbers.
*
* @method Phaser.Math#numberArrayStep
* @param {number} start - The start of the range.
* @param {number} end - The end of the range.
* @param {number} [step=1] - The value to increment or decrement by.
* @returns {Array} Returns the new array of numbers.
* @deprecated 2.2.0 - See {@link Phaser.ArrayUtils.numberArrayStep}
*/
numberArrayStep: function(start, end, step) {
return Phaser.ArrayUtils.numberArrayStep(start, end, step);
},
/**
* Adds the given amount to the value, but never lets the value go over the specified maximum.
*
@ -548,31 +432,6 @@ Phaser.Math = {
},
/**
* Ensures the given value is between min and max inclusive.
*
* @method Phaser.Math#limitValue
* @param {number} value - The value to limit.
* @param {number} min - The minimum the value can be.
* @param {number} max - The maximum the value can be.
* @return {number} The limited value.
* @deprecated 2.2.0 - Use {@link Phaser.Math#clamp}
*/
limitValue: function(value, min, max) {
return Phaser.Math.clamp(value, min, max);
},
/**
* Randomly returns either a 1 or -1.
*
* @method Phaser.Math#randomSign
* @return {number} Either 1 or -1
* @deprecated 2.2.0 - Use {@link Phaser.Utils.randomChoice} or other
*/
randomSign: function () {
return Phaser.Utils.randomChoice(-1, 1);
},
/**
* Returns true if the number given is odd.
*
@ -735,33 +594,6 @@ Phaser.Math = {
},
/**
* Keeps an angle value between the given min and max values.
*
* @method Phaser.Math#angleLimit
* @param {number} angle - The angle value to check. Must be between -180 and +180.
* @param {number} min - The minimum angle that is allowed (must be -180 or greater).
* @param {number} max - The maximum angle that is allowed (must be 180 or less).
* @return {number} The new angle value, returns the same as the input angle if it was within bounds
* @deprecated 2.2.0 - Use {@link Phaser.Math#clamp} instead
*/
angleLimit: function (angle, min, max) {
var result = angle;
if (angle > max)
{
result = max;
}
else if (angle < min)
{
result = min;
}
return result;
},
/**
* A Linear Interpolation Method, mostly used by Phaser.Tween.
*
@ -931,72 +763,6 @@ Phaser.Math = {
return Math.abs(a - b);
},
/**
* Fetch a random entry from the given array.
*
* Will return null if there are no array items that fall within the specified range
* or if there is no item for the randomly choosen index.
*
* @method Phaser.Math#getRandom
* @param {any[]} objects - An array of objects.
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
* @return {object} The random object that was selected.
* @deprecated 2.2.0 - Use {@link Phaser.ArrayUtils.getRandomItem}
*/
getRandom: function (objects, startIndex, length) {
return Phaser.ArrayUtils.getRandomItem(objects, startIndex, length);
},
/**
* Removes a random object from the given array and returns it.
*
* Will return null if there are no array items that fall within the specified range
* or if there is no item for the randomly choosen index.
*
* @method Phaser.Math#removeRandom
* @param {any[]} objects - An array of objects.
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
* @return {object} The random object that was removed.
* @deprecated 2.2.0 - Use {@link Phaser.ArrayUtils.removeRandomItem}
*/
removeRandom: function (objects, startIndex, length) {
return Phaser.ArrayUtils.removeRandomItem(objects, startIndex, length);
},
/**
* _Do not use this function._
*
* Round to the next whole number _towards_ zero.
*
* E.g. `floor(1.7) == 1`, and `floor(-2.7) == -2`.
*
* @method Phaser.Math#floor
* @param {number} value - Any number.
* @return {integer} The rounded value of that number.
* @deprecated 2.2.0 - Use {@link Phaser.Math#truncate} or `Math.trunc` instead.
*/
floor: function (value) {
return Math.trunc(value);
},
/**
* _Do not use this function._
*
* Round to the next whole number _away_ from zero.
*
* E.g. `ceil(1.3) == 2`, and `ceil(-2.3) == -3`.
*
* @method Phaser.Math#ceil
* @param {number} value - Any number.
* @return {integer} The rounded value of that number.
* @deprecated 2.2.0 - Use {@link Phaser.Math#roundAwayFromZero} instead.
*/
ceil: function (value) {
return Phaser.Math.roundAwayFromZero(value);
},
/**
* Round to the next whole number _away_ from zero.
*
@ -1005,8 +771,10 @@ Phaser.Math = {
* @return {integer} The rounded value of that number.
*/
roundAwayFromZero: function (value) {
// "Opposite" of truncate.
return (value > 0) ? Math.ceil(value) : Math.floor(value);
},
/**
@ -1049,34 +817,6 @@ Phaser.Math = {
},
/**
* Moves the element from the start of the array to the end, shifting all items in the process.
*
* @method Phaser.Math#shift
* @param {any[]} array - The array to shift/rotate. The array is modified.
* @return {any} The shifted value.
* @deprecated 2.2.0 - Use {@link Phaser.ArrayUtils.rotate} instead
*/
shift: function (array) {
var s = array.shift();
array.push(s);
return s;
},
/**
* Shuffles the data in the given array into a new order.
* @method Phaser.Math#shuffleArray
* @param {any[]} array - The array to shuffle
* @return {any[]} The array
* @deprecated 2.2.0 - Use {@link Phaser.ArrayUtils.shuffle}
*/
shuffleArray: function (array) {
return Phaser.ArrayUtils.shuffle(array);
},
/**
* Returns the euclidian distance between the two given set of coordinates.
*
@ -1135,21 +875,6 @@ Phaser.Math = {
},
/**
* Returns the rounded distance between the two given set of coordinates.
*
* @method Phaser.Math#distanceRounded
* @param {number} x1
* @param {number} y1
* @param {number} x2
* @param {number} y2
* @return {number} The distance between this Point object and the destination Point object.
* @deprecated 2.2.0 - Do the rounding locally.
*/
distanceRounded: function (x1, y1, x2, y2) {
return Math.round(Phaser.Math.distance(x1, y1, x2, y2));
},
/**
* Force a value within the boundaries by clamping `x` to the range `[a, b]`.
*

View file

@ -264,24 +264,3 @@ Phaser.Canvas = {
}
};
/**
* Get the DOM offset values of any given element
*
* @method Phaser.Canvas.getOffset
* @param {HTMLElement} element - The targeted element that we want to retrieve the offset.
* @param {Phaser.Point} [point] - The point we want to take the x/y values of the offset.
* @return {Phaser.Point} - A point objet with the offsetX and Y as its properties.
* @deprecated 2.1.4 - Use {@link Phaser.DOM.getOffset}
*/
Phaser.Canvas.getOffset = Phaser.DOM.getOffset;
/**
* Returns the aspect ratio of the given canvas.
*
* @method Phaser.Canvas.getAspectRatio
* @param {HTMLCanvasElement} canvas - The canvas to get the aspect ratio from.
* @return {number} The ratio between canvas' width and height.
* @deprecated 2.1.4 - User {@link Phaser.DOM.getAspectRatio}
*/
Phaser.Canvas.getAspectRatio = Phaser.DOM.getAspectRatio;

View file

@ -572,28 +572,6 @@ Phaser.TilemapLayer.prototype.getTiles = function (x, y, width, height, collides
};
/**
* If no valid tileset/image can be found for a tile, the tile is rendered as a rectangle using this as a fill value.
*
* Set to `null` to disable rendering anything for tiles without value tileset images.
*
* @property {?string} tileColor
* @memberof Phaser.TilemapLayer
* @default 'rgb(255, 255, 255)'
* @deprecated Use `debugSettings.missingImageFill` instead.
*/
Object.defineProperty(Phaser.TilemapLayer.prototype, 'tileColor', {
get: function () {
return this.debugSettings.missingImageFill;
},
set: function (value) {
this.debugSettings.missingImageFill = value;
}
});
/**
* Flag controlling if the layer tiles wrap at the edges. Only works if the World size matches the Map size.
*

View file

@ -279,12 +279,3 @@ Object.defineProperty(Phaser.ArraySet.prototype, "next", {
});
Phaser.ArraySet.prototype.constructor = Phaser.ArraySet;
/**
* Phaser.ArrayList is a deprecated alias for Phaser.ArraySet.
*
* @class Phaser.ArrayList
* @constructor
* @deprecated 2.2.0 - Use {@link Phaser.ArraySet} instead.
*/
Phaser.ArrayList = Phaser.ArraySet;

View file

@ -101,45 +101,6 @@ Phaser.Utils = {
return (Math.random() < 0.5) ? choice1 : choice2;
},
/**
* Transposes the elements of the given matrix (array of arrays).
*
* @method Phaser.Utils.transposeArray
* @param {Array<any[]>} array - The matrix to transpose.
* @return {Array<any[]>} A new transposed matrix
* @deprecated 2.2.0 - Use Phaser.ArrayUtils.transposeMatrix
*/
transposeArray: function (array) {
return Phaser.ArrayUtils.transposeMatrix(array);
},
/**
* Rotates the given matrix (array of arrays).
*
* Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}.
*
* @method Phaser.Utils.rotateArray
* @param {Array<any[]>} matrix - The array to rotate; this matrix _may_ be altered.
* @param {number|string} direction - The amount to rotate: the rotation in degrees (90, -90, 270, -270, 180) or a string command ('rotateLeft', 'rotateRight' or 'rotate180').
* @return {Array<any[]>} The rotated matrix. The source matrix should be discarded for the returned matrix.
* @deprecated 2.2.0 - Use Phaser.ArrayUtils.rotateMatrix
*/
rotateArray: function (matrix, direction) {
return Phaser.ArrayUtils.rotateMatrix(matrix, direction);
},
/**
* A standard Fisher-Yates Array shuffle implementation.
*
* @method Phaser.Utils.shuffle
* @param {any[]} array - The array to shuffle.
* @return {any[]} The shuffled array.
* @deprecated 2.2.0 - User Phaser.ArrayUtils.shuffle
*/
shuffle: function (array) {
return Phaser.ArrayUtils.shuffle(array);
},
/**
* Get a unit dimension from a string.
*