Skip to content

Commit ec68786

Browse files
committed
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.
1 parent 6e2cd37 commit ec68786

9 files changed

Lines changed: 12 additions & 222 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ Version 2.1.0 - "Cairhien" - -in development-
9797
* Improved consistency of clone methods on geometry classes (thanks @beeglebug #1130)
9898
* Removed Cache.isSpriteSheet method as no longer required (see #1059)
9999
* Added Cache.getFrameCount to return the number of frames in a FrameData.
100+
* Input.setMoveCallback has been removed due to deprecation.
101+
* BitmapData.refreshBuffer has been removed and replaced with BitmapData.update.
102+
* BitmapData.drawSprite has been removed due to deprecation. Use BitmapData.draw instead.
103+
* Pointer.moveCallback has been removed due to deprecation.
104+
* SinglePad.addButton has been removed due to deprecation.
105+
* P2.Body.loadData has been removed due to deprecation.
106+
* P2.World.defaultFriction and defaultRestitution have been removed due to deprecation.
107+
* Canvas.create noCocoon parameter has been removed due to deprecation.
108+
* Color.getColorInfo, RGBtoHexstring, RGBtoWebstring and colorToHexstring has been removed due to deprecation.
100109

101110
### Bug Fixes
102111

src/gameobjects/BitmapData.js

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ Phaser.BitmapData = function (game, key, width, height) {
134134

135135
// Aliases
136136
this.cls = this.clear;
137-
this.update = this.refreshBuffer;
138137

139138
/**
140139
* @property {number} _tempR - Internal cache var.
@@ -281,7 +280,7 @@ Phaser.BitmapData.prototype = {
281280
this.texture.crop.width = width;
282281
this.texture.crop.height = height;
283282

284-
this.refreshBuffer();
283+
this.update();
285284
this.dirty = true;
286285
}
287286

@@ -298,21 +297,7 @@ Phaser.BitmapData.prototype = {
298297
* @param {number} [width] - The width of the image data area.
299298
* @param {number} [height] - The height of the image data area.
300299
*/
301-
302-
/**
303-
* DEPRECATED: This method will be removed in Phaser 2.1. Please use BitmapData.update instead.
304-
*
305-
* This re-creates the BitmapData.imageData from the current context.
306-
* It then re-builds the ArrayBuffer, the data Uint8ClampedArray reference and the pixels Int32Array.
307-
* If not given the dimensions defaults to the full size of the context.
308-
*
309-
* @method Phaser.BitmapData#refreshBuffer
310-
* @param {number} [x=0] - The x coordinate of the top-left of the image data area to grab from.
311-
* @param {number} [y=0] - The y coordinate of the top-left of the image data area to grab from.
312-
* @param {number} [width] - The width of the image data area.
313-
* @param {number} [height] - The height of the image data area.
314-
*/
315-
refreshBuffer: function (x, y, width, height) {
300+
update: function (x, y, width, height) {
316301

317302
if (typeof x === 'undefined') { x = 0; }
318303
if (typeof y === 'undefined') { y = 0; }
@@ -891,26 +876,6 @@ Phaser.BitmapData.prototype = {
891876

892877
},
893878

894-
/**
895-
* DEPRECATED: Use BitmapData.draw instead.
896-
*
897-
* Draws the given image to this BitmapData at the coordinates specified.
898-
* If you need to only draw a part of the image use BitmapData.copyPixels instead.
899-
*
900-
* @method Phaser.BitmapData#drawSprite
901-
* @param {Phaser.Sprite|Phaser.Image} sprite - The Sprite to draw. Must have a loaded texture and frame.
902-
* @param {number} [x=0] - The x coordinate to draw the Sprite to.
903-
* @param {number} [y=0] - The y coordinate to draw the Sprite to.
904-
*/
905-
drawSprite: function (sprite, x, y) {
906-
907-
if (typeof x === 'undefined') { x = 0; }
908-
if (typeof y === 'undefined') { y = 0; }
909-
910-
this.draw(sprite, x, y);
911-
912-
},
913-
914879
/**
915880
* Draws the given image onto this BitmapData using an image as an alpha mask.
916881
*

src/input/Input.js

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

401401
},
402402

403-
/**
404-
* DEPRECATED: This method will be removed in a future major point release. Please use Input.addMoveCallback instead.
405-
*
406-
* Sets a callback that is fired every time the activePointer receives a DOM move event such as a mousemove or touchmove.
407-
* 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
408-
* to only use if you've limited input to a single pointer (i.e. mouse or touch)
409-
*
410-
* @method Phaser.Input#setMoveCallback
411-
* @param {function} callback - The callback that will be called each time the activePointer receives a DOM move event.
412-
* @param {object} callbackContext - The context in which the callback will be called.
413-
*/
414-
setMoveCallback: function (callback, callbackContext) {
415-
416-
this.moveCallback = callback;
417-
this.moveCallbackContext = callbackContext;
418-
419-
},
420-
421403
/**
422404
* Adds a callback that is fired every time the activePointer receives a DOM move event such as a mousemove or touchmove.
423405
* 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

src/input/Pointer.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,6 @@ Phaser.Pointer.prototype = {
412412
return this;
413413
}
414414

415-
// DEPRECATED - Soon to be removed
416-
if (this.game.input.moveCallback)
417-
{
418-
this.game.input.moveCallback.call(this.game.input.moveCallbackContext, this, this.x, this.y);
419-
}
420-
421415
var i = this.game.input.moveCallbacks.length;
422416

423417
while (i--)

src/input/SinglePad.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,6 @@ Phaser.SinglePad.prototype = {
139139

140140
},
141141

142-
/**
143-
* DEPRECATED: Please see SinglePad.getButton for the same functionality.
144-
*
145-
* If you need more fine-grained control over a gamepad button you can create a new Phaser.GamepadButton object via this method.
146-
* The GamepadButton object can then be polled, have events attached to it, etc.
147-
*
148-
* @method Phaser.SinglePad#addButton
149-
* @param {number} buttonCode - The buttonCode of the button, i.e. Phaser.Gamepad.BUTTON_0, Phaser.Gamepad.XBOX360_A, etc.
150-
* @return {Phaser.GamepadButton} The GamepadButton object which you can store locally and reference directly.
151-
*/
152-
addButton: function (buttonCode) {
153-
154-
return this.getButton(buttonCode);
155-
156-
},
157-
158142
/**
159143
* Gets a GamepadButton object from this controller to be stored and referenced locally.
160144
* The GamepadButton object can then be polled, have events attached to it, etc.

src/physics/p2/Body.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,28 +1270,6 @@ Phaser.Physics.P2.Body.prototype = {
12701270

12711271
return true;
12721272

1273-
},
1274-
1275-
/**
1276-
* DEPRECATED: This method will soon be removed from the API. Please avoid using.
1277-
* Reads the physics data from a physics data file stored in the Game.Cache.
1278-
* It will add the shape data to this Body, as well as set the density (mass).
1279-
*
1280-
* @method Phaser.Physics.P2.Body#loadData
1281-
* @param {string} key - The key of the Physics Data file as stored in Game.Cache.
1282-
* @param {string} object - The key of the object within the Physics data file that you wish to load the shape data from.
1283-
* @return {boolean} True on success, else false.
1284-
*/
1285-
loadData: function (key, object) {
1286-
1287-
var data = this.game.cache.getPhysicsData(key, object);
1288-
1289-
if (data && data.shape)
1290-
{
1291-
this.mass = data.density;
1292-
return this.loadPolygon(key, object);
1293-
}
1294-
12951273
}
12961274

12971275
};

src/physics/p2/World.js

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,26 +1670,6 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "friction", {
16701670

16711671
});
16721672

1673-
/**
1674-
* @name Phaser.Physics.P2#defaultFriction
1675-
* @property {number} defaultFriction - DEPRECATED: Use World.friction instead.
1676-
*/
1677-
Object.defineProperty(Phaser.Physics.P2.prototype, "defaultFriction", {
1678-
1679-
get: function () {
1680-
1681-
return this.world.defaultContactMaterial.friction;
1682-
1683-
},
1684-
1685-
set: function (value) {
1686-
1687-
this.world.defaultContactMaterial.friction = value;
1688-
1689-
}
1690-
1691-
});
1692-
16931673
/**
16941674
* @name Phaser.Physics.P2#restitution
16951675
* @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", {
17101690

17111691
});
17121692

1713-
/**
1714-
* @name Phaser.Physics.P2#defaultRestitution
1715-
* @property {number} defaultRestitution - DEPRECATED: Use World.restitution instead.
1716-
*/
1717-
Object.defineProperty(Phaser.Physics.P2.prototype, "defaultRestitution", {
1718-
1719-
get: function () {
1720-
1721-
return this.world.defaultContactMaterial.restitution;
1722-
1723-
},
1724-
1725-
set: function (value) {
1726-
1727-
this.world.defaultContactMaterial.restitution = value;
1728-
1729-
}
1730-
1731-
});
1732-
17331693
/**
17341694
* @name Phaser.Physics.P2#contactMaterial
17351695
* @property {p2.ContactMaterial} contactMaterial - The default Contact Material being used by the World.

src/system/Canvas.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@ Phaser.Canvas = {
1919
* @param {number} [width=256] - The width of the canvas element.
2020
* @param {number} [height=256] - The height of the canvas element..
2121
* @param {string} [id=''] - If given this will be set as the ID of the canvas element, otherwise no ID will be set.
22-
* @param {boolean} [noCocoon=false] - DEPRECATED: This parameter is no longer used.
2322
* @return {HTMLCanvasElement} The newly created canvas element.
2423
*/
25-
create: function (width, height, id, noCocoon) {
26-
27-
if (typeof noCocoon === 'undefined') { noCocoon = false; }
24+
create: function (width, height, id) {
2825

2926
width = width || 256;
3027
height = height || 256;

src/utils/Color.js

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -873,85 +873,6 @@ Phaser.Color = {
873873
*/
874874
getBlue: function (color) {
875875
return color & 0xFF;
876-
},
877-
878-
// The following are all DEPRECATED
879-
880-
/**
881-
* DEPRECATED: This method will be removed in Phaser 2.1.
882-
* Returns a string containing handy information about the given color including string hex value,
883-
* RGB format information. Each section starts on a newline, 3 lines in total.
884-
*
885-
* @method Phaser.Color.getColorInfo
886-
* @static
887-
* @param {number} color - A color value in the format 0xAARRGGBB.
888-
* @returns {string} String containing the 3 lines of information.
889-
*/
890-
getColorInfo: function (color) {
891-
892-
var argb = Phaser.Color.getRGB(color);
893-
894-
// Hex format
895-
var result = Phaser.Color.RGBtoHexstring(color) + "\n";
896-
897-
// RGB format
898-
result = result.concat("Alpha: " + argb.alpha + " Red: " + argb.red + " Green: " + argb.green + " Blue: " + argb.blue) + "\n";
899-
900-
return result;
901-
902-
},
903-
904-
/**
905-
* DEPRECATED: This method will be removed in Phaser 2.1. Please use Phaser.Color.RGBtoString instead.
906-
* Return a string representation of the color in the format 0xAARRGGBB.
907-
*
908-
* @method Phaser.Color.RGBtoHexstring
909-
* @static
910-
* @param {number} color - The color to get the string representation for
911-
* @returns {string} A string of length 10 characters in the format 0xAARRGGBB
912-
*/
913-
RGBtoHexstring: function (color) {
914-
915-
var argb = Phaser.Color.getRGB(color);
916-
917-
return "0x" + Phaser.Color.colorToHexstring(argb.alpha) + Phaser.Color.colorToHexstring(argb.red) + Phaser.Color.colorToHexstring(argb.green) + Phaser.Color.colorToHexstring(argb.blue);
918-
919-
},
920-
921-
/**
922-
* DEPRECATED: This method will be removed in Phaser 2.1. Please use Phaser.Color.RGBtoString instead.
923-
* Return a string representation of the color in the format #RRGGBB.
924-
*
925-
* @method Phaser.Color.RGBtoWebstring
926-
* @static
927-
* @param {number} color - The color to get the string representation for.
928-
* @returns {string} A string of length 10 characters in the format 0xAARRGGBB.
929-
*/
930-
RGBtoWebstring: function (color) {
931-
932-
var argb = Phaser.Color.getRGB(color);
933-
934-
return "#" + Phaser.Color.colorToHexstring(argb.red) + Phaser.Color.colorToHexstring(argb.green) + Phaser.Color.colorToHexstring(argb.blue);
935-
936-
},
937-
938-
/**
939-
* DEPRECATED: This method will be removed in Phaser 2.1. Please use Phaser.Color.componentToHex instead.
940-
* Return a string containing a hex representation of the given color.
941-
*
942-
* @method Phaser.Color.colorToHexstring
943-
* @static
944-
* @param {number} color - The color channel to get the hex value for, must be a value between 0 and 255).
945-
* @returns {string} A string of length 2 characters, i.e. 255 = FF, 0 = 00.
946-
*/
947-
colorToHexstring: function (color) {
948-
949-
var digits = "0123456789ABCDEF";
950-
var lsd = color % 16;
951-
var msd = (color - lsd) / 16;
952-
var hexified = digits.charAt(msd) + digits.charAt(lsd);
953-
return hexified;
954-
955876
}
956877

957878
};

0 commit comments

Comments
 (0)