<static> whenReady(handler, context, nonPrimer)
Add a device-ready handler and ensure the device ready sequence is started.
Phaser.Device will not activate or initialize until at least one whenReady
handler is added,
which is normally done automatically be calling new Phaser.Game(..)
.
The handler is invoked when the device is considered "ready", which may be immediately
if the device is already "ready". See deviceReadyAt.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
handler | function | Callback to invoke when the device is ready. It is invoked with the given context the Phaser.Device object is supplied as the first argument. | ||
context | object | <optional> | Context in which to invoke the handler | |
nonPrimer | boolean | <optional> | false | If true the device ready check will not be started. |
- Source code: utils/Device.js (Line 560)
Please login to continue.