It is not possible to instantiate the Device class manually.
This signal is dispatched after device initialization occurs but before any of the ready
callbacks (see whenReady) have been invoked.
Local "patching" for a particular device can/should be done in this event.
Note: This signal is removed after the device has been readied; if a handler has not been
added before new Phaser.Game(..)
it is probably too late.
Is running on android?
Set to true if running in Arora.
Are Audio tags available?
If the browser supports the Full Screen API this holds the call you need to use to cancel it.
Is canvas available?
True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap.
Set to true if running in Chrome.
Is running on chromeOS?
If running in Chrome this will contain the major version number.
Is the game running under CocoonJS?
Is this game running with CocoonJS.App?
Is the game running under Apache Cordova?
Is the game running under the Intel Crosswalk XDK?
Is css3D available?
Is running on a desktop?
The time the device became ready.
Can this device play EC-3 Dolby Digital Plus files?
Set to true if running in Microsoft Edge browser.
Is the game running under Ejecta?
Is the game running under GitHub Electron?
Set to true if running in Epiphany.
Is file available?
Is fileSystem available?
Set to true if running in Firefox.
If running in Firefox this will contain the major version number.
Does the browser support the Full Screen API?
Does the browser support access to the Keyboard during Full Screen mode?
Does the device support the getUserMedia API?
Can this device play h264 mp4 video files?
Can this device play hls video files?
Set to true if running in Internet Explorer.
If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Device.trident and Device.tridentVersion.
The time as which initialization has completed.
Is running on iOS?
If running in iOS this will contain the major version number.
Is running on iPad?
Is running on iPhone?
Is running on iPhone4?
Is running on linux?
Same value as littleEndian
.
Is the device big or little endian? (only detected if the browser supports TypedArrays)
Is localStorage available?
Can this device play m4a files? True if this device can play m4a files.
Is running on macOS?
Set to true if running in Midori.
Set to true if running in Mobile Safari.
Can this device play mp3 files?
Can this device play h264 mp4 video files?
Is mspointer available?
Is the game running under Node.js?
Is the game running under Node-Webkit?
Can this device play ogg files?
Can this device play ogg video files?
Set to true if running in Opera.
Can this device play opus files?
PixelRatio of the host device?
Is Pointer Lock available?
Is the browser running in strict mode (false) or quirks mode? (true)
If the browser supports the Full Screen API this holds the call you need to use to activate it.
Set to true if running in Safari.
If running in Safari this will contain the major version number.
Set to true if running in the Silk browser (as used on the Amazon Kindle)
Does the device context support 32bit pixel manipulation using array buffer views?
Is touch available?
Set to true if running a Trident version of Internet Explorer (IE11+)
If running in Internet Explorer 11 this will contain the major version number. See http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx
Does the browser support TypedArrays?
Does the device support the Vibration API?
Can this device play vp9 video files?
Can this device play wav files?
Set to true if running as a WebApp, i.e. within a WebView
Is the WebAudio API available?
Is webGL available?
Can this device play webm files?
Can this device play webm video files?
Name | Type | Argument | Description |
---|---|---|---|
wheelType | string | <nullable> | The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll' |
Is running on windows?
Is running on a Windows Phone?
Is worker available?
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.
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. |
Check whether the host environment can play audio.
Name | Type | Description |
---|---|---|
type | string | One of 'mp3, 'ogg', 'm4a', 'wav', 'webm' or 'opus'. |
True if the given file type is supported by the browser, otherwise false.
Check whether the host environment can play video files.
Name | Type | Description |
---|---|---|
type | string | One of 'mp4, 'ogg', 'webm' or 'mpeg'. |
True if the given file type is supported by the browser, otherwise false.
Detect if the host is a an Android Stock browser.
This is available before the device "ready" event.
Authors might want to scale down on effects and switch to the CANVAS rendering method on those devices.
var defaultRenderingMode = Phaser.Device.isAndroidStockBrowser() ? Phaser.CANVAS : Phaser.AUTO;
Check whether the console is open.
Note that this only works in Firefox with Firebug and earlier versions of Chrome.
It used to work in Chrome, but then they removed the ability: http://src.chromium.org/viewvc/blink?view=revision&revision=151136
© 2016 Richard Davey, Photon Storm Ltd.
Licensed under the MIT License.
http://phaser.io/docs/2.6.2/Phaser.Device.html