Creates a new Overlap Collider object and adds it to the simulation.
A Collider is a way to automatically perform overlap checks between two objects, calling the collide and process callbacks if they occur.
Colliders are run as part of the World update, after all of the Bodies have updated.
By creating a Collider you don't need then call World.overlap
in your update
loop,
as it will be handled for you automatically.
name | type | arguments | description |
---|---|---|---|
object1 | Phaser.Types.Physics.Arcade.ArcadeColliderType |
The first object to check for overlap. |
|
object2 | Phaser.Types.Physics.Arcade.ArcadeColliderType |
The second object to check for overlap. |
|
collideCallback | Phaser.Types.Physics.Arcade.ArcadePhysicsCallback | <optional> |
The callback to invoke when the two objects overlap. |
processCallback | Phaser.Types.Physics.Arcade.ArcadePhysicsCallback | <optional> |
The callback to invoke when the two objects overlap. Must return a boolean. |
callbackContext | * | <optional> |
The scope in which to call the callbacks. |
The Collider that was created.