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
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,9 @@ New Features
120
120
* Emitter.bringToTop and Emitter.sendToBack are booleans that let you optionally set the display order of the Particle when emitted.
121
121
* Emitter now calls the Phaser.Particle.onEmit function, which is left empty for you to override and add in custom behaviours.
122
122
* p2.World has a new contactMaterial property, which can be configured like a normal P2 Contact Material and is applied when two bodies hit that don't have defined materials.
123
+
* Group.remove has a new 'destroy' parameter (false by default), which will optionally call destroy on the item removed from the Group.
124
+
* Group.removeAll has a new 'destroy' parameter (false by default), which will optionally call destroy on the items removed from the Group.
125
+
* Group.removeBetween has a new 'destroy' parameter (false by default), which will optionally call destroy on the items removed from the Group.
123
126
124
127
125
128
Bug Fixes
@@ -140,6 +143,7 @@ Bug Fixes
140
143
* Emitter.minParticleScale and maxParticleScale wasn't resetting the Body size correctly.
141
144
* Group.removeBetween now properly iterates through the children.
142
145
* P2.World had a type in the restitution method title. Now fixed.
146
+
* Objects with an InputHandler now deactivate it when the object is removed from a Group but not destroyed (fix #672)
@@ -1442,6 +1453,11 @@ Phaser.Group.prototype.removeAll = function () {
1442
1453
}
1443
1454
1444
1455
this.removeChild(this.children[0]);
1456
+
1457
+
if(destroy)
1458
+
{
1459
+
this.children[0].destroy();
1460
+
}
1445
1461
}
1446
1462
while(this.children.length>0);
1447
1463
@@ -1455,10 +1471,12 @@ Phaser.Group.prototype.removeAll = function () {
1455
1471
* @method Phaser.Group#removeBetween
1456
1472
* @param {number} startIndex - The index to start removing children from.
1457
1473
* @param {number} [endIndex] - The index to stop removing children at. Must be higher than startIndex. If undefined this method will remove all children between startIndex and the end of the Group.
1474
+
* @param {boolean} [destroy=false] - You can optionally call destroy on the child that was removed.
@@ -74,12 +75,6 @@ Phaser.Physics.P2.Body = function (game, sprite, x, y, mass) {
74
75
*/
75
76
this.gravity=newPhaser.Point();
76
77
77
-
/**
78
-
* Dispatched when the shape/s of this Body impact with another. The event will be sent 2 parameters, this Body and the impact Body.
79
-
* @property {Phaser.Signal} onImpact
80
-
*/
81
-
this.onImpact=newPhaser.Signal();
82
-
83
78
/**
84
79
* Dispatched when a first contact is created between shapes in two bodies. This event is fired during the step, so collision has already taken place.
85
80
* The event will be sent 4 parameters: The body it is in contact with, the shape from this body that caused the contact, the shape from the contact body and the contact equation data array.
@@ -96,7 +91,6 @@ Phaser.Physics.P2.Body = function (game, sprite, x, y, mass) {
96
91
97
92
/**
98
93
* @property {array} collidesWith - Array of CollisionGroups that this Bodies shapes collide with.
99
-
* @private
100
94
*/
101
95
this.collidesWith=[];
102
96
@@ -105,6 +99,15 @@ Phaser.Physics.P2.Body = function (game, sprite, x, y, mass) {
105
99
*/
106
100
this.removeNextStep=false;
107
101
102
+
/**
103
+
* @property {Phaser.Physics.P2.BodyDebug} debugBody - Reference to the debug body.
104
+
*/
105
+
this.debugBody=null;
106
+
107
+
/**
108
+
* @property {boolean} _collideWorldBounds - Internal var that determines if this Body collides with the world bounds or not.
109
+
* @private
110
+
*/
108
111
this._collideWorldBounds=true;
109
112
110
113
/**
@@ -131,11 +134,6 @@ Phaser.Physics.P2.Body = function (game, sprite, x, y, mass) {
131
134
*/
132
135
this._groupCallbackContext={};
133
136
134
-
/**
135
-
* @property {Phaser.Physics.P2.BodyDebug} debugBody - Reference to the debug body.
@@ -102,16 +102,14 @@ Phaser.Physics.P2 = function (game, config) {
102
102
this.onContactMaterialRemoved=newPhaser.Signal();
103
103
104
104
/**
105
-
* @property {Phaser.Signal} onPostBroadphase - Dispatched after the Broadphase has collected collision pairs in the world.
105
+
* @property {function} postBroadphaseCallback - A postBroadphase callback.
106
106
*/
107
107
this.postBroadphaseCallback=null;
108
-
this.callbackContext=null;
109
108
110
109
/**
111
-
* @property {Phaser.Signal} onImpact - Dispatched when a first contact is created between two bodies. This event is fired after the step has been done.
110
+
* @property {object} callbackContext - The context under which the callbacks are fired.
112
111
*/
113
-
// this.onImpact = new Phaser.Signal();
114
-
this.impactCallback=null;
112
+
this.callbackContext=null;
115
113
116
114
/**
117
115
* @property {Phaser.Signal} onBeginContact - Dispatched when a first contact is created between two bodies. This event is fired before the step has been done.
@@ -137,27 +135,42 @@ Phaser.Physics.P2 = function (game, config) {
0 commit comments