Input.setMoveCallback has been removed due to deprecation.

BitmapData.refreshBuffer has been removed and replaced with BitmapData.update.
BitmapData.drawSprite has been removed due to deprecation. Use BitmapData.draw instead.
Pointer.moveCallback has been removed due to deprecation.
SinglePad.addButton has been removed due to deprecation.
P2.Body.loadData has been removed due to deprecation.
P2.World.defaultFriction and defaultRestitution have been removed due to deprecation.
Canvas.create noCocoon parameter has been removed due to deprecation.
Color.getColorInfo, RGBtoHexstring, RGBtoWebstring and colorToHexstring has been removed due to deprecation.
This commit is contained in:
photonstorm 2014-08-28 03:40:59 +01:00
parent 6e2cd37776
commit ec687868de
9 changed files with 12 additions and 222 deletions

View file

@ -97,6 +97,15 @@ Version 2.1.0 - "Cairhien" - -in development-
* Improved consistency of clone methods on geometry classes (thanks @beeglebug #1130)
* Removed Cache.isSpriteSheet method as no longer required (see #1059)
* Added Cache.getFrameCount to return the number of frames in a FrameData.
* Input.setMoveCallback has been removed due to deprecation.
* BitmapData.refreshBuffer has been removed and replaced with BitmapData.update.
* BitmapData.drawSprite has been removed due to deprecation. Use BitmapData.draw instead.
* Pointer.moveCallback has been removed due to deprecation.
* SinglePad.addButton has been removed due to deprecation.
* P2.Body.loadData has been removed due to deprecation.
* P2.World.defaultFriction and defaultRestitution have been removed due to deprecation.
* Canvas.create noCocoon parameter has been removed due to deprecation.
* Color.getColorInfo, RGBtoHexstring, RGBtoWebstring and colorToHexstring has been removed due to deprecation.
### Bug Fixes

View file

@ -134,7 +134,6 @@ Phaser.BitmapData = function (game, key, width, height) {
// Aliases
this.cls = this.clear;
this.update = this.refreshBuffer;
/**
* @property {number} _tempR - Internal cache var.
@ -281,7 +280,7 @@ Phaser.BitmapData.prototype = {
this.texture.crop.width = width;
this.texture.crop.height = height;
this.refreshBuffer();
this.update();
this.dirty = true;
}
@ -298,21 +297,7 @@ Phaser.BitmapData.prototype = {
* @param {number} [width] - The width of the image data area.
* @param {number} [height] - The height of the image data area.
*/
/**
* DEPRECATED: This method will be removed in Phaser 2.1. Please use BitmapData.update instead.
*
* This re-creates the BitmapData.imageData from the current context.
* It then re-builds the ArrayBuffer, the data Uint8ClampedArray reference and the pixels Int32Array.
* If not given the dimensions defaults to the full size of the context.
*
* @method Phaser.BitmapData#refreshBuffer
* @param {number} [x=0] - The x coordinate of the top-left of the image data area to grab from.
* @param {number} [y=0] - The y coordinate of the top-left of the image data area to grab from.
* @param {number} [width] - The width of the image data area.
* @param {number} [height] - The height of the image data area.
*/
refreshBuffer: function (x, y, width, height) {
update: function (x, y, width, height) {
if (typeof x === 'undefined') { x = 0; }
if (typeof y === 'undefined') { y = 0; }
@ -891,26 +876,6 @@ Phaser.BitmapData.prototype = {
},
/**
* DEPRECATED: Use BitmapData.draw instead.
*
* Draws the given image to this BitmapData at the coordinates specified.
* If you need to only draw a part of the image use BitmapData.copyPixels instead.
*
* @method Phaser.BitmapData#drawSprite
* @param {Phaser.Sprite|Phaser.Image} sprite - The Sprite to draw. Must have a loaded texture and frame.
* @param {number} [x=0] - The x coordinate to draw the Sprite to.
* @param {number} [y=0] - The y coordinate to draw the Sprite to.
*/
drawSprite: function (sprite, x, y) {
if (typeof x === 'undefined') { x = 0; }
if (typeof y === 'undefined') { y = 0; }
this.draw(sprite, x, y);
},
/**
* Draws the given image onto this BitmapData using an image as an alpha mask.
*

View file

@ -400,24 +400,6 @@ Phaser.Input.prototype = {
},
/**
* DEPRECATED: This method will be removed in a future major point release. Please use Input.addMoveCallback instead.
*
* Sets a callback that is fired every time the activePointer receives a DOM move event such as a mousemove or touchmove.
* It will be called every time the activePointer moves, which in a multi-touch game can be a lot of times, so this is best
* to only use if you've limited input to a single pointer (i.e. mouse or touch)
*
* @method Phaser.Input#setMoveCallback
* @param {function} callback - The callback that will be called each time the activePointer receives a DOM move event.
* @param {object} callbackContext - The context in which the callback will be called.
*/
setMoveCallback: function (callback, callbackContext) {
this.moveCallback = callback;
this.moveCallbackContext = callbackContext;
},
/**
* Adds a callback that is fired every time the activePointer receives a DOM move event such as a mousemove or touchmove.
* It will be called every time the activePointer moves, which in a multi-touch game can be a lot of times, so this is best

View file

@ -412,12 +412,6 @@ Phaser.Pointer.prototype = {
return this;
}
// DEPRECATED - Soon to be removed
if (this.game.input.moveCallback)
{
this.game.input.moveCallback.call(this.game.input.moveCallbackContext, this, this.x, this.y);
}
var i = this.game.input.moveCallbacks.length;
while (i--)

View file

@ -139,22 +139,6 @@ Phaser.SinglePad.prototype = {
},
/**
* DEPRECATED: Please see SinglePad.getButton for the same functionality.
*
* If you need more fine-grained control over a gamepad button you can create a new Phaser.GamepadButton object via this method.
* The GamepadButton object can then be polled, have events attached to it, etc.
*
* @method Phaser.SinglePad#addButton
* @param {number} buttonCode - The buttonCode of the button, i.e. Phaser.Gamepad.BUTTON_0, Phaser.Gamepad.XBOX360_A, etc.
* @return {Phaser.GamepadButton} The GamepadButton object which you can store locally and reference directly.
*/
addButton: function (buttonCode) {
return this.getButton(buttonCode);
},
/**
* Gets a GamepadButton object from this controller to be stored and referenced locally.
* The GamepadButton object can then be polled, have events attached to it, etc.

View file

@ -1270,28 +1270,6 @@ Phaser.Physics.P2.Body.prototype = {
return true;
},
/**
* DEPRECATED: This method will soon be removed from the API. Please avoid using.
* Reads the physics data from a physics data file stored in the Game.Cache.
* It will add the shape data to this Body, as well as set the density (mass).
*
* @method Phaser.Physics.P2.Body#loadData
* @param {string} key - The key of the Physics Data file as stored in Game.Cache.
* @param {string} object - The key of the object within the Physics data file that you wish to load the shape data from.
* @return {boolean} True on success, else false.
*/
loadData: function (key, object) {
var data = this.game.cache.getPhysicsData(key, object);
if (data && data.shape)
{
this.mass = data.density;
return this.loadPolygon(key, object);
}
}
};

View file

@ -1670,26 +1670,6 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "friction", {
});
/**
* @name Phaser.Physics.P2#defaultFriction
* @property {number} defaultFriction - DEPRECATED: Use World.friction instead.
*/
Object.defineProperty(Phaser.Physics.P2.prototype, "defaultFriction", {
get: function () {
return this.world.defaultContactMaterial.friction;
},
set: function (value) {
this.world.defaultContactMaterial.friction = value;
}
});
/**
* @name Phaser.Physics.P2#restitution
* @property {number} restitution - Default coefficient of restitution between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair.
@ -1710,26 +1690,6 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "restitution", {
});
/**
* @name Phaser.Physics.P2#defaultRestitution
* @property {number} defaultRestitution - DEPRECATED: Use World.restitution instead.
*/
Object.defineProperty(Phaser.Physics.P2.prototype, "defaultRestitution", {
get: function () {
return this.world.defaultContactMaterial.restitution;
},
set: function (value) {
this.world.defaultContactMaterial.restitution = value;
}
});
/**
* @name Phaser.Physics.P2#contactMaterial
* @property {p2.ContactMaterial} contactMaterial - The default Contact Material being used by the World.

View file

@ -19,12 +19,9 @@ Phaser.Canvas = {
* @param {number} [width=256] - The width of the canvas element.
* @param {number} [height=256] - The height of the canvas element..
* @param {string} [id=''] - If given this will be set as the ID of the canvas element, otherwise no ID will be set.
* @param {boolean} [noCocoon=false] - DEPRECATED: This parameter is no longer used.
* @return {HTMLCanvasElement} The newly created canvas element.
*/
create: function (width, height, id, noCocoon) {
if (typeof noCocoon === 'undefined') { noCocoon = false; }
create: function (width, height, id) {
width = width || 256;
height = height || 256;

View file

@ -873,85 +873,6 @@ Phaser.Color = {
*/
getBlue: function (color) {
return color & 0xFF;
},
// The following are all DEPRECATED
/**
* DEPRECATED: This method will be removed in Phaser 2.1.
* Returns a string containing handy information about the given color including string hex value,
* RGB format information. Each section starts on a newline, 3 lines in total.
*
* @method Phaser.Color.getColorInfo
* @static
* @param {number} color - A color value in the format 0xAARRGGBB.
* @returns {string} String containing the 3 lines of information.
*/
getColorInfo: function (color) {
var argb = Phaser.Color.getRGB(color);
// Hex format
var result = Phaser.Color.RGBtoHexstring(color) + "\n";
// RGB format
result = result.concat("Alpha: " + argb.alpha + " Red: " + argb.red + " Green: " + argb.green + " Blue: " + argb.blue) + "\n";
return result;
},
/**
* DEPRECATED: This method will be removed in Phaser 2.1. Please use Phaser.Color.RGBtoString instead.
* Return a string representation of the color in the format 0xAARRGGBB.
*
* @method Phaser.Color.RGBtoHexstring
* @static
* @param {number} color - The color to get the string representation for
* @returns {string} A string of length 10 characters in the format 0xAARRGGBB
*/
RGBtoHexstring: function (color) {
var argb = Phaser.Color.getRGB(color);
return "0x" + Phaser.Color.colorToHexstring(argb.alpha) + Phaser.Color.colorToHexstring(argb.red) + Phaser.Color.colorToHexstring(argb.green) + Phaser.Color.colorToHexstring(argb.blue);
},
/**
* DEPRECATED: This method will be removed in Phaser 2.1. Please use Phaser.Color.RGBtoString instead.
* Return a string representation of the color in the format #RRGGBB.
*
* @method Phaser.Color.RGBtoWebstring
* @static
* @param {number} color - The color to get the string representation for.
* @returns {string} A string of length 10 characters in the format 0xAARRGGBB.
*/
RGBtoWebstring: function (color) {
var argb = Phaser.Color.getRGB(color);
return "#" + Phaser.Color.colorToHexstring(argb.red) + Phaser.Color.colorToHexstring(argb.green) + Phaser.Color.colorToHexstring(argb.blue);
},
/**
* DEPRECATED: This method will be removed in Phaser 2.1. Please use Phaser.Color.componentToHex instead.
* Return a string containing a hex representation of the given color.
*
* @method Phaser.Color.colorToHexstring
* @static
* @param {number} color - The color channel to get the hex value for, must be a value between 0 and 255).
* @returns {string} A string of length 2 characters, i.e. 255 = FF, 0 = 00.
*/
colorToHexstring: function (color) {
var digits = "0123456789ABCDEF";
var lsd = color % 16;
var msd = (color - lsd) / 16;
var hexified = digits.charAt(msd) + digits.charAt(lsd);
return hexified;
}
};