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
takes a predicate function and passes child, index, and the entire child array to it.
return an ArrayList containing all children that the predicate returns true for.
@@ -1198,6 +1198,37 @@ Phaser.Group.prototype.postUpdate = function () {
1198
1198
1199
1199
};
1200
1200
1201
+
1202
+
/**
1203
+
* Allows you to obtain a Phaser.ArrayList of children that return true for the given predicate
1204
+
* For example:
1205
+
* var healthyList = Group.filter(function(child, index, children) {
1206
+
* if(child.exists && child.health > 10) {
1207
+
* return true;
1208
+
* }
1209
+
* });
1210
+
* healthyList.callAll('attack');
1211
+
* Note: Currently this will skip any children which are Groups themselves.
1212
+
* @method Phaser.Group#filter
1213
+
* @param {function} predicate - The function that each child will be evaluated against. Each child of the Group will be passed to it as its first parameter, the index as the second, and the entire child array as the third
1214
+
* @param {boolean} [checkExists=false] - If set only children with exists=true will be passed to the callback, otherwise all children will be passed.
0 commit comments