Phaser API Documentation

  Version: 
setCollideWorldBounds([value], [bounceX], [bounceY], [onWorldBounds])

Description:

Sets whether this Body collides with the world boundary.

Optionally also sets the World Bounce and onWorldBounds values.

Parameters:

name type arguments Default description
value boolean <optional> true

true if the Body should collide with the world bounds, otherwise false.

bounceX number <optional>

If given this replaces the Body's worldBounce.x value.

bounceY number <optional>

If given this replaces the Body's worldBounce.y value.

onWorldBounds boolean <optional>

If given this replaces the Body's onWorldBounds value.

Returns:
Description:

This Body object.

Since: 3.0.0