sys Class

Module: _decorator Parent Module: cc

System variables

Index

Properties
Methods
  • getNetworkType Get the network type of current device, return cc.sys.NetworkType.LAN if failure.
  • getBatteryLevel Get the battery level of current device, return 1.0 if failure.
  • garbageCollect Forces the garbage collection, only available in JSB
  • restartVM Restart the JS VM, only available in JSB
  • isObjectValid In web engine, it will return true if the object exist
  • dump Dump system informations
  • openURL Open a url in browser
  • now Get the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.

Details

Properties

LANGUAGE_ENGLISH

English language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:40
LANGUAGE_CHINESE

Chinese language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:47
LANGUAGE_FRENCH

French language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:54
LANGUAGE_ITALIAN

Italian language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:61
LANGUAGE_GERMAN

German language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:68
LANGUAGE_SPANISH

Spanish language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:75
LANGUAGE_DUTCH

Spanish language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:82
LANGUAGE_RUSSIAN

Russian language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:89
LANGUAGE_KOREAN

Korean language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:96
LANGUAGE_JAPANESE

Japanese language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:103
LANGUAGE_HUNGARIAN

Hungarian language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:110
LANGUAGE_PORTUGUESE

Portuguese language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:117
LANGUAGE_ARABIC

Arabic language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:124
LANGUAGE_NORWEGIAN

Norwegian language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:131
LANGUAGE_POLISH

Polish language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:138
LANGUAGE_TURKISH

Turkish language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:145
LANGUAGE_UKRAINIAN

Ukrainian language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:152
LANGUAGE_ROMANIAN

Romanian language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:159
LANGUAGE_BULGARIAN

Bulgarian language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:166
LANGUAGE_UNKNOWN

Unknown language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:173
OS_IOS
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:180
OS_ANDROID
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:185
OS_WINDOWS
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:190
OS_MARMALADE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:195
OS_LINUX
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:200
OS_BADA
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:205
OS_BLACKBERRY
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:210
OS_OSX
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:215
OS_WP8
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:220
OS_WINRT
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:225
OS_UNKNOWN
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:230
UNKNOWN
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:236
WIN32
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:242
LINUX
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:248
MACOS
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:254
ANDROID
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:260
IPHONE
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:266
IPAD
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:272
BLACKBERRY
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:278
NACL
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:284
EMSCRIPTEN
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:290
TIZEN
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:296
WINRT
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:302
WP8
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:308
MOBILE_BROWSER
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:314
DESKTOP_BROWSER
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:320
EDITOR_PAGE

Indicates whether executes in editor's window process (Electron's renderer context)

meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:327
EDITOR_CORE

Indicates whether executes in editor's main process (Electron's browser context)

meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:334
WECHAT_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:341
QQ_PLAY
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:347
BROWSER_TYPE_WECHAT

BROWSER_TYPE_WECHAT

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:353
BROWSER_TYPE_WECHAT_GAME

BROWSER_TYPE_WECHAT_GAME

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:360
BROWSER_TYPE_WECHAT_GAME_SUB

BROWSER_TYPE_WECHAT_GAME_SUB

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:367
BROWSER_TYPE_QQ_PLAY

BROWSER_TYPE_QQ_PLAY

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:374
BROWSER_TYPE_ANDROID
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:381
BROWSER_TYPE_IE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:388
BROWSER_TYPE_QQ
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:395
BROWSER_TYPE_MOBILE_QQ
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:402
BROWSER_TYPE_UC
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:409
BROWSER_TYPE_UCBS

uc third party integration.

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:416
BROWSER_TYPE_360
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:423
BROWSER_TYPE_BAIDU_APP
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:430
BROWSER_TYPE_BAIDU
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:437
BROWSER_TYPE_MAXTHON
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:444
BROWSER_TYPE_OPERA
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:451
BROWSER_TYPE_OUPENG
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:458
BROWSER_TYPE_MIUI
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:465
BROWSER_TYPE_FIREFOX
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:472
BROWSER_TYPE_SAFARI
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:479
BROWSER_TYPE_CHROME
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:486
BROWSER_TYPE_LIEBAO
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:493
BROWSER_TYPE_QZONE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:500
BROWSER_TYPE_SOUGOU
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:507
BROWSER_TYPE_UNKNOWN
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:514
isNative

Is native ? This is set to be true in jsb auto.

meta description
Type Boolean
Defined in cocos2d/core/platform/CCSys.js:522
isBrowser

Is web browser ?

meta description
Type Boolean
Defined in cocos2d/core/platform/CCSys.js:529
isMobile

Indicate whether system is mobile system

meta description
Type Boolean
Defined in cocos2d/core/platform/CCSys.js:714
platform

Indicate the running platform

meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:720
language

Indicate the current language of the running system

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:731
os

Indicate the running os name

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:765
osVersion

Indicate the running os version

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:770
osMainVersion

Indicate the running os main version

meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:775
browserType

Indicate the running browser type

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:781
browserVersion

Indicate the running browser version

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:818
windowPixelResolution

Indicate the real pixel resolution of the whole game window

meta description
Type Size
Defined in cocos2d/core/platform/CCSys.js:836
localStorage

cc.sys.localStorage is a local storage component.

meta description
Type Object
Defined in cocos2d/core/platform/CCSys.js:869
capabilities

The capabilities of the current platform

meta description
Type Object
Defined in cocos2d/core/platform/CCSys.js:942

Methods

getNetworkType

Get the network type of current device, return cc.sys.NetworkType.LAN if failure.

meta description
Returns NetworkType
Defined in cocos2d/core/platform/CCSys.js:1093
getBatteryLevel

Get the battery level of current device, return 1.0 if failure.

meta description
Returns Number
Defined in cocos2d/core/platform/CCSys.js:1107
garbageCollect

Forces the garbage collection, only available in JSB

meta description
Defined in cocos2d/core/platform/CCSys.js:1121
restartVM

Restart the JS VM, only available in JSB

meta description
Defined in cocos2d/core/platform/CCSys.js:1129
isObjectValid

Check whether an object is valid, In web engine, it will return true if the object exist In native engine, it will return true if the JS object and the correspond native object are both valid

meta description
Returns Boolean
Defined in cocos2d/core/platform/CCSys.js:1137
Parameters
dump

Dump system informations

meta description
Defined in cocos2d/core/platform/CCSys.js:1152
openURL

Open a url in browser

meta description
Defined in cocos2d/core/platform/CCSys.js:1171
Parameters
now

Get the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.

meta description
Returns Number
Defined in cocos2d/core/platform/CCSys.js:1185

results matching ""

    No results matching ""