Device constants: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This article is an overview of device related constants. | |||
{| class=" | {| | ||
|- | | | ||
{| class="consttab" align="left" | |||
|- | |||
! '''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 | ||
|} | |} | ||
| | |||
{| class=" | {| class="consttab" align="left" | ||
|- | |- | ||
! '''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 | ||
|} | |} | ||
|- | |- | ||
|''' | | | ||
{| class="consttab" align="left" | |||
|- | |||
! '''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 | ||
|} | |||
| | |||
{| class="consttab" align="left" | |||
|- | |||
! '''Constant''' !! '''Description''' | |||
|- | |||
| os_browser | |||
|Returns one of the following constants | |||
|- | |||
| browser_not_a_browser | |||
|Game is not being played in a browser | |||
|- | |||
| browser_unknown | |||
|Unknown browser | |||
|- | |||
| browser_ie | |||
|Internet Explorer | |||
|- | |||
| browser_firefox | |||
|Mozilla Firefox | |||
|- | |||
| browser_chrome | |||
|Google Chrome | |||
|- | |||
| browser_safari | |||
|Safari | |||
|- | |||
| browser_opera | |||
|Opera | |||
|- | |||
| browser_safari_mobile | |||
|Safari Mobile | |||
|- | |||
| browser_windows_store | |||
|Windows 8 App | |||
|} | |||
|} | |} | ||
== Operating System Version == | == Operating System Version == | ||
'''os_version''' | The operating system version can be obtained with the '''os_version''' constant, it will return the corresponding values below. | ||
{| class=" | *'''iOS version''': (major_version * 16777216) + (minor_version * 4096) + build_number | ||
|- | *'''Max OS X version''': (major_version * 16777216) + (minor_version * 4096) + build_number | ||
| '''Android Version''' | *'''Windows version''': majorVersion * 65536 + minorVersion) | ||
*'''Windows phone version''': majorVersion * 65536 + minorVersion | |||
{| | |||
| | |||
{| class="consttab" align="left" | |||
|- | |||
! '''Mac OS X Version''' !! '''Value''' | |||
|- | |||
|Cheetah (10.0.4) || 167772164 | |||
|- | |||
|Puma (10.1.5) || 167776261 | |||
|- | |||
|Jaguar (10.2.8) || 167780360 | |||
|- | |||
|Panther (10.3.9) || 167784457 | |||
|- | |||
|Tiger (10.4.11) || 167788555 | |||
|- | |||
|Leopard (10.5.8) || 167792648 | |||
|- | |||
|Snow Leopard (10.6.8) || 167796744 | |||
|- | |||
|Lion (10.7.5) || 167800837 | |||
|- | |||
|Mountain Lion (10.8.2) || 167804930 | |||
|} | |||
| | |||
{| class="consttab" align="left" | |||
|- | |||
! '''Windows Version''' !! '''Value''' | |||
|- | |||
|Windows 8 (6.2) || 393218 | |||
|- | |||
|Windows Server 2012 (6.2) || 393218 | |||
|- | |||
|Windows 7 (6.1) || 393217 | |||
|- | |||
|Windows Server 2008 R2 (6.1) || 393217 | |||
|- | |||
|Windows Server 2008 (6.0) || 393216 | |||
|- | |||
|Windows Vista (6.0) || 393216 | |||
|- | |||
|Windows Server 2003 R2 (5.2) || 327682 | |||
|- | |||
|Windows Server 2003 (5.2) || 327682 | |||
|- | |||
|Windows XP 64-Bit Edition (5.2) || 327682 | |||
|- | |||
|Windows XP (5.1) || 327681 | |||
|- | |||
|Windows 2000 (5.0) || 327680 | |||
|} | |||
| | |||
{| class="consttab" align="left" | |||
|- | |||
! '''Android Version''' !! '''Value''' | |||
|- | |- | ||
|Cupcake (1.5) || 3 | |Cupcake (1.5) || 3 | ||
Line 130: | 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) || 50335747 | |||
|- | |||
|iOS 4 (4.2.1) || 67117057 | |||
|- | |||
|iOS 5 (5.1.1) || 83890177 | |||
|- | |||
|iOS 6 (6.0.1) || 100663297 | |||
|- | |||
|iOS 6 (6.0.2) || 100663298 | |||
|- | |- | ||
|iOS 6 (6.1) || 100667392 | |||
|} | |} | ||
| | |||
{| class=" | {| class="consttab" align="left" | ||
|- | |- | ||
! '''Windows Phone Version''' !! '''Value''' | |||
|- | |||
|Windows Phone 8 (8.0) || 524288 | |||
|- | |- | ||
| | |Windows Phone 7.5 (7.1) || 458753 | ||
| | |||
| | |||
|- | |- | ||
|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
|
|
|
|
|