Sprite vs. Sprite Group Body Tests.

This commit is contained in:
photonstorm
2014-02-03 04:09:45 +00:00
parent 33d47cf9e9
commit 3488880956
7 changed files with 497 additions and 53 deletions
+21 -15
View File
@@ -96,6 +96,11 @@ Phaser.Group = function (game, parent, name, useStage) {
*/
this.scale = this._container.scale;
/**
* @property {Phaser.Point} pivot - The pivot point of the Group container.
*/
this.pivot = this._container.pivot;
/**
* The cursor is a simple way to iterate through the objects in a Group using the Group.next and Group.previous functions.
* The cursor is set to the first child added to the Group and doesn't change unless you call next, previous or set it directly with Group.cursor.
@@ -164,14 +169,14 @@ Phaser.Group.prototype = {
{
child.group = this;
this._container.addChild(child);
child.updateTransform();
if (child.events)
{
child.events.onAddedToGroup.dispatch(child, this);
}
this._container.addChild(child);
child.updateTransform();
}
if (this.cursor === null)
@@ -209,14 +214,14 @@ Phaser.Group.prototype = {
{
child.group = this;
this._container.addChildAt(child, index);
child.updateTransform();
if (child.events)
{
child.events.onAddedToGroup.dispatch(child, this);
}
this._container.addChildAt(child, index);
child.updateTransform();
}
if (this.cursor === null)
@@ -265,15 +270,15 @@ Phaser.Group.prototype = {
child.visible = exists;
child.alive = exists;
this._container.addChild(child);
child.updateTransform();
if (child.events)
{
child.events.onAddedToGroup.dispatch(child, this);
}
this._container.addChild(child);
child.updateTransform();
if (this.cursor === null)
{
this.cursor = child;
@@ -307,14 +312,15 @@ Phaser.Group.prototype = {
child.visible = exists;
child.alive = exists;
this._container.addChild(child);
child.updateTransform();
if (child.events)
{
child.events.onAddedToGroup.dispatch(child, this);
}
this._container.addChild(child);
child.updateTransform();
if (this.cursor === null)
{
this.cursor = child;