mirror of
https://github.com/wassname/phaser.git
synced 2026-08-19 12:30:07 +08:00
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:
+12
-12
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user