You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -321,7 +321,8 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
321
321
* The InputHandler.flagged property has been removed. It was never used internally, or exposed via the API, so was just overhead.
322
322
* The src/system folder has been removed and all files relocated to the src/utils folder. This doesn't change anything from an API point of view, but did change the grunt build scripts slightly.
323
323
* BitmapData.shadow and BitmapData.text now both `return this` keeping them in-line with the docs (thanks @greeny#2634)
324
-
* Group.align has had its argument orders swapped, so that it's now `(columns, rows, ...)` instead of `(rows, columns, ...)` (thanks @deargle#2643)
324
+
* Group.align has had its arguments changed so that it's now `(width, height, ...)` instead of `(rows, columns, ...)` (thanks @deargle#2643)
325
+
* Group.align now returns `true` if the Group was aligned, or `false` if not.
Copy file name to clipboardExpand all lines: src/core/Group.js
+16-13Lines changed: 16 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -685,7 +685,7 @@ Phaser.Group.prototype.updateZ = function () {
685
685
* the `alignTo` method in order to be positioned by this call. All default Phaser Game Objects have
686
686
* this.
687
687
*
688
-
* The grid dimensions are determined by the first four arguments. The `rows` and `columns` arguments
688
+
* The grid dimensions are determined by the first four arguments. The `width` and `height` arguments
689
689
* relate to the width and height of the grid respectively.
690
690
*
691
691
* For example if the Group had 100 children in it:
@@ -699,13 +699,13 @@ Phaser.Group.prototype.updateZ = function () {
699
699
*
700
700
* This will align the children into a grid of 25x4, again using 32 pixels per grid cell.
701
701
*
702
-
* You can choose to set _either_ the `rows` or `columns` value to -1. Doing so tells the method
702
+
* You can choose to set _either_ the `width` or `height` value to -1. Doing so tells the method
703
703
* to keep on aligning children until there are no children left. For example if this Group had
704
704
* 48 children in it, the following:
705
705
*
706
706
* `Group.align(-1, 8, 32, 32)`
707
707
*
708
-
* ... will align the children so that there are 8 rows vertically (the second argument),
708
+
* ... will align the children so that there are 8 children vertically (the second argument),
709
709
* and each row will contain 6 sprites, except the last one, which will contain 5 (totaling 48)
710
710
*
711
711
* You can also do:
@@ -723,26 +723,27 @@ Phaser.Group.prototype.updateZ = function () {
723
723
* The final argument; `offset` lets you start the alignment from a specific child index.
724
724
*
725
725
* @method Phaser.Group#align
726
-
* @param {integer} columns - The number of columns, or width, of the grid. Set to -1 for a dynamic width.
727
-
* @param {integer} rows - The number of rows, or height, of the grid. Set to -1 for a dynamic height.
726
+
* @param {integer} width - The width of the grid in items (not pixels). Set to -1 for a dynamic width. If -1 then you must set an explicit height value.
727
+
* @param {integer} height - The height of the grid in items (not pixels). Set to -1 for a dynamic height. If -1 then you must set an explicit width value.
728
728
* @param {integer} cellWidth - The width of each grid cell, in pixels.
729
729
* @param {integer} cellHeight - The height of each grid cell, in pixels.
730
730
* @param {integer} [position] - The position constant. One of `Phaser.TOP_LEFT` (default), `Phaser.TOP_CENTER`, `Phaser.TOP_RIGHT`, `Phaser.LEFT_CENTER`, `Phaser.CENTER`, `Phaser.RIGHT_CENTER`, `Phaser.BOTTOM_LEFT`, `Phaser.BOTTOM_CENTER` or `Phaser.BOTTOM_RIGHT`.
731
731
* @param {integer} [offset=0] - Optional index to start the alignment from. Defaults to zero, the first child in the Group, but can be set to any valid child index value.
732
+
* @return {boolean} True if the Group children were aligned, otherwise false.
0 commit comments