Phaser API Documentation

  Version: 

Member of: Phaser.Device

OS

Description:

Determines the operating system of the device running this Phaser Game instance. These values are read-only and populated during the boot sequence of the game. They are then referenced by internal game systems and are available for you to access via this.sys.game.device.os from within any Scene.

Properties:
name type description
android boolean

Is running on android?

chromeOS boolean

Is running on chromeOS?

cordova boolean

Is the game running under Apache Cordova?

crosswalk boolean

Is the game running under the Intel Crosswalk XDK?

desktop boolean

Is running on a desktop?

ejecta boolean

Is the game running under Ejecta?

electron boolean

Is the game running under GitHub Electron?

iOS boolean

Is running on iOS?

iPad boolean

Is running on iPad?

iPhone boolean

Is running on iPhone?

kindle boolean

Is running on an Amazon Kindle?

linux boolean

Is running on linux?

macOS boolean

Is running on macOS?

node boolean

Is the game running under Node.js?

nodeWebkit boolean

Is the game running under Node-Webkit?

webApp boolean

Set to true if running as a WebApp, i.e. within a WebView

windows boolean

Is running on windows?

windowsPhone boolean

Is running on a Windows Phone?

iOSVersion number

If running in iOS this will contain the major version number.

pixelRatio number

PixelRatio of the host device?

Type:
object
Since: 3.0.0
Source: src/device/OS.js (Line 7)