From 94d9fa6e778f0ce07fafe0d2ae07960fdf36eb6f Mon Sep 17 00:00:00 2001 From: photonstorm Date: Tue, 5 Nov 2013 21:44:27 +0000 Subject: [PATCH] Tidying up some docs. --- README.md | 1 + src/utils/Utils.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bdb63ad697..733212b93d 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Version 1.1.3 - in build * New: Added Mouse.pointerLock signal which you can listen to whenever the browser enters or leaves pointer lock mode. * New: StageScaleMode.forceOrientation allows you to lock your game to one orientation and display a Sprite (i.e. a "please rotate" screen) when incorrect. * New: World.visible boolean added, toggles rendering of the world on/off entirely. +* New: Polygon class & drawPolygon method added to Graphics (thanks rjimenezda) * Fixed: Mouse.stop now uses the true useCapture, which means the event listeners stop listening correctly (thanks beeglebug) * Fixed: Input Keyboard example fix (thanks Atrodilla) * Updated: ArcadePhysics.updateMotion applies the dt to the velocity calculations as well as position now (thanks jcs) diff --git a/src/utils/Utils.js b/src/utils/Utils.js index 05634dc6a8..6be67fe6a2 100644 --- a/src/utils/Utils.js +++ b/src/utils/Utils.js @@ -10,6 +10,12 @@ */ Phaser.Utils = { + /** + * A standard Fisher-Yates Array shuffle implementation. + * @method Phaser.Utils.shuffle + * @param {array} array - The array to shuffle. + * @return {array} The shuffled array. + */ shuffle: function (array) { for (var i = array.length - 1; i > 0; i--) @@ -26,14 +32,14 @@ Phaser.Utils = { /** * Javascript string pad http://www.webtoolkit.info/. - * pad = the string to pad it out with (defaults to a space)
+ * pad = the string to pad it out with (defaults to a space) * dir = 1 (left), 2 (right), 3 (both) * @method Phaser.Utils.pad * @param {string} str - The target string. * @param {number} len - Description. * @param {number} pad - the string to pad it out with (defaults to a space). * @param {number} [dir=3] the direction dir = 1 (left), 2 (right), 3 (both). - * @return {string} + * @return {string} The padded string */ pad: function (str, len, pad, dir) {