Fixed an issue where passing null as the Group parent wouldn't set it to game.world as it should have (thanks tito100).

Continued work on the tilemap collision - again, please don't use this version if you need working tilemaps.
This commit is contained in:
photonstorm
2013-12-06 01:07:25 +00:00
parent ea3802a556
commit 1f513a333e
7 changed files with 123 additions and 94 deletions
+12 -12
View File
@@ -10,32 +10,32 @@
* @classdesc A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
* @constructor
* @param {Phaser.Game} game - A reference to the currently running game.
* @param {*} parent - The parent Group or DisplayObjectContainer that will hold this group, if any.
* @param {*} parent - The parent Group or DisplayObjectContainer that will hold this group, if any. If not set, or set to null, it will use game.world.
* @param {string} [name=group] - A name for this Group. Not used internally but useful for debugging.
* @param {boolean} [useStage=false] - Should the DisplayObjectContainer this Group creates be added to the World (default, false) or direct to the Stage (true).
*/
Phaser.Group = function (game, parent, name, useStage) {
if (typeof parent === 'undefined' || typeof parent === null)
/**
* @property {Phaser.Game} game - A reference to the currently running Game.
*/
this.game = game;
if (typeof parent === 'undefined' || parent === null)
{
parent = game.world;
}
/**
* @property {string} name - A name for this Group. Not used internally but useful for debugging.
*/
this.name = name || 'group';
if (typeof useStage === 'undefined')
{
useStage = false;
}
/**
* @property {Phaser.Game} game - A reference to the currently running Game.
*/
this.game = game;
/**
* @property {string} name - A name for this Group. Not used internally but useful for debugging.
*/
this.name = name || 'group';
if (useStage)
{
this._container = this.game.stage._stage;