Device constants: Difference between revisions

From ENIGMA
Jump to navigation Jump to search
No edit summary
No edit summary
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
Device constants for mobile games.
This article is an overview of device related constants.


{| class="wikitable" cellpadding=5 cellspacing=0 border=0 style="background-color:#FAD796; border: 2px; border-style: solid; border-color:gray;"
{|
|- cellpadding=5 cellspacing=0 border=0 style="background-color:black; color:white;"
|
| '''Constant'''  
{| class="consttab" align="left"
| '''Description'''
|-  
! '''Constant''' !! '''Description'''
|-
|-
|'''mb_left'''
| mb_left
|The left mouse button
|left mouse button
|-
|-
|'''mb_middle'''
| mb_middle
|The middle mouse button (this may not be valid for all target platforms)
|middle mouse button (this may not be valid on platforms without a middle mouse button)
|-
|-
|'''mb_right'''
| mb_right
|The right mouse button
|right mouse button
|-
|-
|'''mb_none'''
| mb_none
|No mouse button
|no mouse button
|-
|-
|'''mb_any'''
| mb_any
|Any of the mouse buttons
|any of the mouse buttons
|}
|}
 
|
{| class="wikitable" cellpadding=5 cellspacing=0 border=0 style="background-color:#FAD796; border: 2px; border-style: solid; border-color:gray;"
{| class="consttab" align="left"
|- cellpadding=5 cellspacing=0 border=0 style="background-color:black; color:white;"
|-  
| '''Constant'''  
! '''Constant''' !! '''Description'''
| '''Description'''
|-
|-
|'''os_type'''
| os_type  
|Returns one of the following constants
|Returns one of the following constants
|-
|-
|'''os_windows'''
| os_windows  
|Windows OS
|Windows OS
|-
|-
|'''os_win32'''
| os_win32  
|Windows 32bit OS
|Windows 32bit OS
|-
|-
|'''os_symbian'''
| os_symbian  
|Symbian OS
|Symbian OS
|-
|-
|'''os_android'''
| os_android  
|Android
|Android
|-
|-
|'''os_psp'''
| os_psp  
|PlayStation Portable (PSP)
|PlayStation Portable (PSP)
|-
|-
|'''os_linux'''
| os_linux  
|Linux
|Linux
|-
|-
|'''os_macosx'''
| os_macosx  
|Mac OS X
|Mac OS X
|-
|-
|'''os_ios'''
| os_ios  
|iOS (iPhone, iPad, iPod Touch)
|iOS (iPhone, iPad, iPod Touch)
|-
|-
|'''os_winphone'''
| os_winphone  
|Windows 8 Phone
|Windows 8 Phone
|-
|-
|'''os_unknown'''
| os_unknown  
|unknown OS
|unknown OS
|}
|-
|
{| class="consttab" align="left"
|-
! '''Constant''' !! '''Description'''
|-
| os_device
|Returns one of the following constants
|-
| device_ios_ipad
|iPad
|-
| device_ios_ipad_retina
|iPad with Retina display (2048x1536 screen)
|-
| device_ios_iphone5
|iPhone5 with larger display (640x1136 screen)
|-
| device_ios_iphone
|iPhone/iPod Touch (480x320 screen) or Android phone
|-
| device_ios_iphone_retina
|iPhone/iPod Touch with Retina display (960x640 screen)
|-
| device_emulator
|emulator (Windows Phone or Android)
|-
| device_tablet
|Android tablet
|-
| device_ios_unknown
|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 ==
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
{|
|
{| 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
|-
|Donut (1.6) || 4
|-
| Eclair (2.0) || 5
|-
| Eclair (2.0.1) || 6
|-
| Eclair (2.1) || 7
|-
| Froyo (2.2.x) || 8
|-
| Gingerbread (2.3 - 2.3.2) || 9
|-
| Gingerbread (2.3.3 - 2.3.7) || 10
|-
| Honeycomb (3.0) || 11
|-
| Honeycomb (3.1) || 12
|-
| Honeycomb (3.2.x) || 13
|-
| Ice Cream Sandwich (4.0.1 - 4.0.2) || 14
|-
| Ice Cream Sandwich (4.0.3 - 4.0.4) || 15
|-
| Jelly Bean (4.1.x) || 16
|}
|
{| 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="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.

Constant Description
mb_left left mouse button
mb_middle middle mouse button (this may not be valid on platforms without a middle mouse button)
mb_right right mouse button
mb_none no mouse button
mb_any any of the mouse buttons
Constant Description
os_type Returns one of the following constants
os_windows Windows OS
os_win32 Windows 32bit OS
os_symbian Symbian OS
os_android Android
os_psp PlayStation Portable (PSP)
os_linux Linux
os_macosx Mac OS X
os_ios iOS (iPhone, iPad, iPod Touch)
os_winphone Windows 8 Phone
os_unknown unknown OS
Constant Description
os_device Returns one of the following constants
device_ios_ipad iPad
device_ios_ipad_retina iPad with Retina display (2048x1536 screen)
device_ios_iphone5 iPhone5 with larger display (640x1136 screen)
device_ios_iphone iPhone/iPod Touch (480x320 screen) or Android phone
device_ios_iphone_retina iPhone/iPod Touch with Retina display (960x640 screen)
device_emulator emulator (Windows Phone or Android)
device_tablet Android tablet
device_ios_unknown Unknown or not iOS
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

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
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
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
Android Version Value
Cupcake (1.5) 3
Donut (1.6) 4
Eclair (2.0) 5
Eclair (2.0.1) 6
Eclair (2.1) 7
Froyo (2.2.x) 8
Gingerbread (2.3 - 2.3.2) 9
Gingerbread (2.3.3 - 2.3.7) 10
Honeycomb (3.0) 11
Honeycomb (3.1) 12
Honeycomb (3.2.x) 13
Ice Cream Sandwich (4.0.1 - 4.0.2) 14
Ice Cream Sandwich (4.0.3 - 4.0.4) 15
Jelly Bean (4.1.x) 16
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
Windows Phone Version Value
Windows Phone 8 (8.0) 524288
Windows Phone 7.5 (7.1) 458753
Windows Phone 7 (7.0) 458752