Device constants: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This article is an overview of device related constants. | This article is an overview of device related constants. | ||
{| | {| | ||
| | | | ||
{| class="consttab" align="left" | {| class="consttab" align="left" | ||
Line 7: | Line 7: | ||
! '''Constant''' !! '''Description''' | ! '''Constant''' !! '''Description''' | ||
|- | |- | ||
| | | mb_left | ||
|left mouse button | |left mouse button | ||
|- | |- | ||
| | | mb_middle | ||
|middle mouse button (this may not be valid on platforms without a middle mouse button) | |middle mouse button (this may not be valid on platforms without a middle mouse button) | ||
|- | |- | ||
| | | mb_right | ||
|right mouse button | |right mouse button | ||
|- | |- | ||
| | | mb_none | ||
|no mouse button | |no mouse button | ||
|- | |- | ||
| | | mb_any | ||
|any of the mouse buttons | |any of the mouse buttons | ||
|} | |} | ||
Line 27: | Line 27: | ||
! '''Constant''' !! '''Description''' | ! '''Constant''' !! '''Description''' | ||
|- | |- | ||
| | | os_type | ||
|Returns one of the following constants | |Returns one of the following constants | ||
|- | |- | ||
| | | os_windows | ||
|Windows OS | |Windows OS | ||
|- | |- | ||
| | | os_win32 | ||
|Windows 32bit OS | |Windows 32bit OS | ||
|- | |- | ||
| | | os_symbian | ||
|Symbian OS | |Symbian OS | ||
|- | |- | ||
| | | os_android | ||
|Android | |Android | ||
|- | |- | ||
| | | os_psp | ||
|PlayStation Portable (PSP) | |PlayStation Portable (PSP) | ||
|- | |- | ||
| | | os_linux | ||
|Linux | |Linux | ||
|- | |- | ||
| | | os_macosx | ||
|Mac OS X | |Mac OS X | ||
|- | |- | ||
| | | os_ios | ||
|iOS (iPhone, iPad, iPod Touch) | |iOS (iPhone, iPad, iPod Touch) | ||
|- | |- | ||
| | | os_winphone | ||
|Windows 8 Phone | |Windows 8 Phone | ||
|- | |- | ||
| | | os_unknown | ||
|unknown OS | |unknown OS | ||
|} | |} | ||
Line 66: | Line 66: | ||
! '''Constant''' !! '''Description''' | ! '''Constant''' !! '''Description''' | ||
|- | |- | ||
| | | os_device | ||
|Returns one of the following constants | |Returns one of the following constants | ||
|- | |- | ||
| | | device_ios_ipad | ||
|iPad | |iPad | ||
|- | |- | ||
| | | device_ios_ipad_retina | ||
|iPad with Retina display (2048x1536 screen) | |iPad with Retina display (2048x1536 screen) | ||
|- | |- | ||
| | | device_ios_iphone5 | ||
|iPhone5 with larger display (640x1136 screen) | |iPhone5 with larger display (640x1136 screen) | ||
|- | |- | ||
| | | device_ios_iphone | ||
|iPhone/iPod Touch (480x320 screen) or Android phone | |iPhone/iPod Touch (480x320 screen) or Android phone | ||
|- | |- | ||
| | | device_ios_iphone_retina | ||
|iPhone/iPod Touch with Retina display (960x640 screen) | |iPhone/iPod Touch with Retina display (960x640 screen) | ||
|- | |- | ||
| | | device_emulator | ||
|emulator (Windows Phone or Android) | |emulator (Windows Phone or Android) | ||
|- | |- | ||
| | | device_tablet | ||
|Android tablet | |Android tablet | ||
|- | |- | ||
| | | device_ios_unknown | ||
|Unknown or not iOS | |Unknown or not iOS | ||
|} | |} | ||
Line 98: | Line 98: | ||
! '''Constant''' !! '''Description''' | ! '''Constant''' !! '''Description''' | ||
|- | |- | ||
| | | os_browser | ||
|Returns one of the following constants | |Returns one of the following constants | ||
|- | |- | ||
| | | browser_not_a_browser | ||
|Game is not being played in a browser | |Game is not being played in a browser | ||
|- | |- | ||
| | | browser_unknown | ||
|Unknown browser | |Unknown browser | ||
|- | |- | ||
| | | browser_ie | ||
|Internet Explorer | |Internet Explorer | ||
|- | |- | ||
| | | browser_firefox | ||
|Mozilla Firefox | |Mozilla Firefox | ||
|- | |- | ||
| | | browser_chrome | ||
|Google Chrome | |Google Chrome | ||
|- | |- | ||
| | | browser_safari | ||
|Safari | |Safari | ||
|- | |- | ||
| | | browser_opera | ||
|Opera | |Opera | ||
|- | |- | ||
| | | browser_safari_mobile | ||
|Safari Mobile | |Safari Mobile | ||
|- | |- | ||
| | | browser_windows_store | ||
|Windows 8 App | |Windows 8 App | ||
|} | |} | ||
|} | |} | ||
== Operating System Version == | == Operating System Version == | ||
The operating system version can be obtained with the '''os_version''' constant, it will return the corresponding values below. | The operating system version can be obtained with the '''os_version''' constant, it will return the corresponding values below. | ||
Line 136: | Line 137: | ||
*'''Windows version''': majorVersion * 65536 + minorVersion) | *'''Windows version''': majorVersion * 65536 + minorVersion) | ||
*'''Windows phone version''': majorVersion * 65536 + minorVersion | *'''Windows phone version''': majorVersion * 65536 + minorVersion | ||
{| | |||
{| class=" | | | ||
|- | {| class="consttab" align="left" | ||
|- | |||
! '''Mac OS X Version''' !! '''Value''' | |||
|- | |- | ||
|Cheetah (10.0.4) || 167772164 | |Cheetah (10.0.4) || 167772164 | ||
Line 160: | Line 161: | ||
|Mountain Lion (10.8.2) || 167804930 | |Mountain Lion (10.8.2) || 167804930 | ||
|} | |} | ||
| | |||
{| class=" | {| class="consttab" align="left" | ||
|- | |- | ||
! '''Windows Version''' !! '''Value''' | |||
|- | |- | ||
|Windows 8 (6.2) || 393218 | |Windows 8 (6.2) || 393218 | ||
Line 188: | Line 188: | ||
|Windows 2000 (5.0) || 327680 | |Windows 2000 (5.0) || 327680 | ||
|} | |} | ||
| | |||
{| class=" | {| class="consttab" align="left" | ||
|- | |- | ||
! '''Android Version''' !! '''Value''' | |||
|- | |- | ||
|Cupcake (1.5) || 3 | |Cupcake (1.5) || 3 | ||
Line 222: | Line 221: | ||
| Jelly Bean (4.1.x) || 16 | | Jelly Bean (4.1.x) || 16 | ||
|} | |} | ||
| | |||
{| class=" | {| class="consttab" align="left" | ||
|- | |- | ||
! '''iOS Version''' !! '''Value''' | |||
|- | |- | ||
|iOS 3 (3.1.3) || | |iOS 3 (3.1.3) || 50335747 | ||
|- | |- | ||
|iOS 4 (4.2.1) || | |iOS 4 (4.2.1) || 67117057 | ||
|- | |- | ||
|iOS 5 (5.1.1) || | |iOS 5 (5.1.1) || 83890177 | ||
|- | |- | ||
|iOS 6 (6.0.1) || | |iOS 6 (6.0.1) || 100663297 | ||
|- | |- | ||
|iOS 6 (6.0.2) || | |iOS 6 (6.0.2) || 100663298 | ||
|- | |- | ||
|iOS 6 (6.1) || | |iOS 6 (6.1) || 100667392 | ||
|} | |} | ||
| | |||
{| class=" | {| class="consttab" align="left" | ||
|- | |- | ||
! '''Windows Phone Version''' !! '''Value''' | |||
|- | |- | ||
|Windows Phone 8 (8.0) || | |Windows Phone 8 (8.0) || 524288 | ||
|- | |- | ||
|Windows Phone 7.5 (7.1) || | |Windows Phone 7.5 (7.1) || 458753 | ||
|- | |- | ||
|Windows Phone 7 (7.0) || | |Windows Phone 7 (7.0) || 458752 | ||
|} | |} |
Latest revision as of 19:34, 17 September 2013
This article is an overview of device related constants.
|
| ||||||||||||||||||||||||||||||||||||||||||
|
|
Operating System Version
The operating system version can be obtained with the os_version constant, it will return the corresponding values below.
- iOS version: (major_version * 16777216) + (minor_version * 4096) + build_number
- Max OS X version: (major_version * 16777216) + (minor_version * 4096) + build_number
- Windows version: majorVersion * 65536 + minorVersion)
- Windows phone version: majorVersion * 65536 + minorVersion
|
|
|
|
|