onOverlap : Phaser.Signal
A Signal that is dispatched when this Body overlaps with another Body.
You still need to call game.physics.arcade.overlap
in your update
method in order
for this signal to be dispatched.
Usually you'd pass a callback to the overlap
method, but this signal provides for
a different level of notification.
Due to the potentially high volume of signals this could create it is disabled by default.
To use this feature set this property to a Phaser.Signal: sprite.body.onOverlap = new Phaser.Signal()
and it will be called when a collision happens, passing two arguments: the sprites which collided.
The first sprite in the argument is always the owner of this Body.
If two Bodies with this Signal set collide, both will dispatch the Signal.
- Source code: physics/arcade/Body.js (Line 241)
Please login to continue.