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
* Checks for overlaps between two game objects. The objects can be Sprites, Groups or Emitters.
341
341
* You can perform Sprite vs. Sprite, Sprite vs. Group and Group vs. Group overlap checks.
342
342
* Unlike collide the objects are NOT automatically separated or have any physics applied, they merely test for overlap results.
343
-
* The second parameter can be an array of objects, of differing types.
343
+
* Both the first and second parameter can be arrays of objects, of differing types.
344
+
* If two arrays are passed, the contents of the first parameter will be tested against all contents of the 2nd parameter.
344
345
* NOTE: This function is not recursive, and will not test against children of objects passed (i.e. Groups within Groups).
345
346
*
346
347
* @method Phaser.Physics.Arcade#overlap
347
-
* @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter} object1 - The first object to check. Can be an instance of Phaser.Sprite, Phaser.Group or Phaser.Particles.Emitter.
348
+
* @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|array} object1 - The first object or array of objects to check. Can be Phaser.Sprite, Phaser.Group or Phaser.Particles.Emitter.
348
349
* @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|array} object2 - The second object or array of objects to check. Can be Phaser.Sprite, Phaser.Group or Phaser.Particles.Emitter.
349
350
* @param {function} [overlapCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them.
350
351
* @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then overlapCallback will only be called if processCallback returns true.
351
352
* @param {object} [callbackContext] - The context in which to run the callbacks.
352
-
* @return {boolean} True if an overlap occured otherwise false.
353
+
* @return {boolean} True if an overlap occurred otherwise false.
* Checks for collision between two game objects. You can perform Sprite vs. Sprite, Sprite vs. Group, Group vs. Group, Sprite vs. Tilemap Layer or Group vs. Tilemap Layer collisions.
381
-
* The second parameter can be an array of objects, of differing types.
399
+
* Both the first and second parameter can be arrays of objects, of differing types.
400
+
* If two arrays are passed, the contents of the first parameter will be tested against all contents of the 2nd parameter.
382
401
* The objects are also automatically separated. If you don't require separation then use ArcadePhysics.overlap instead.
383
402
* An optional processCallback can be provided. If given this function will be called when two sprites are found to be colliding. It is called before any separation takes place,
384
403
* giving you the chance to perform additional checks. If the function returns true then the collision and separation is carried out. If it returns false it is skipped.
385
404
* The collideCallback is an optional function that is only called if two sprites collide. If a processCallback has been set then it needs to return true for collideCallback to be called.
386
405
* NOTE: This function is not recursive, and will not test against children of objects passed (i.e. Groups or Tilemaps within other Groups).
387
406
*
388
407
* @method Phaser.Physics.Arcade#collide
389
-
* @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|Phaser.Tilemap} object1 - The first object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter, or Phaser.Tilemap.
408
+
* @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|Phaser.Tilemap|array} object1 - The first object or array of objects to check. Can be Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter, or Phaser.Tilemap.
390
409
* @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|Phaser.Tilemap|array} object2 - The second object or array of objects to check. Can be Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter or Phaser.Tilemap.
391
410
* @param {function} [collideCallback=null] - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them, unless you are colliding Group vs. Sprite, in which case Sprite will always be the first parameter.
392
411
* @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them.
0 commit comments