Phaser API Documentation

  Version: 
setSleepEvents(start, end)

Description:

Enable sleep and wake events for this body.

By default when a body goes to sleep, or wakes up, it will not emit any events.

The events are emitted by the Matter World instance and can be listened to via the SLEEP_START and SLEEP_END events.

Parameters:

name type description
start boolean

true if you want the sleep start event to be emitted for this body.

end boolean

true if you want the sleep end event to be emitted for this body.

Returns:
Description:

This Game Object.

Since: 3.0.0