Physics.Arcade.Body#onWorldBounds

onWorldBounds : Phaser.Signal

A Signal that is dispatched when this Body collides with the world bounds.
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.onWorldBounds = new Phaser.Signal()
and it will be called when a collision happens, passing five arguments:
onWorldBounds(sprite, up, down, left, right)
where the Sprite is a reference to the Sprite that owns this Body, and the other arguments are booleans
indicating on which side of the world the Body collided.

Source code: physics/arcade/Body.js (Line 201)
doc_phaser
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.