Physics World events added.

Group has new 'addToWorld' parameter, which fulfills the same function as the old useStage.
Stage now extends PIXI.Stage rather than owns one.
This commit is contained in:
photonstorm
2014-02-12 19:45:09 +00:00
parent 424d1126bc
commit f6113ac6c4
10 changed files with 401 additions and 159 deletions
+5 -5
View File
@@ -12,9 +12,9 @@
* @param {Phaser.Game} game - A reference to the currently running game.
* @param {*} parent - The parent Group, DisplayObject or DisplayObjectContainer that this Group will be added to. If undefined or 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 this Group be added to the World (default, false) or direct to the Stage (true).
* @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
*/
Phaser.Group = function (game, parent, name, useStage) {
Phaser.Group = function (game, parent, name, addToStage) {
/**
* @property {Phaser.Game} game - A reference to the currently running Game.
@@ -33,7 +33,7 @@ Phaser.Group = function (game, parent, name, useStage) {
PIXI.DisplayObjectContainer.call(this);
if (typeof useStage === 'undefined')
if (typeof addToStage === 'undefined')
{
if (parent)
{
@@ -41,12 +41,12 @@ Phaser.Group = function (game, parent, name, useStage) {
}
else
{
this.game.stage._stage.addChild(this);
this.game.stage.addChild(this);
}
}
else
{
this.game.stage._stage.addChild(this);
this.game.stage.addChild(this);
}
/**