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
  • getSafeAreaRect Return the safe area rect.
  • 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:48
LANGUAGE_CHINESE

Chinese language code

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

French language code

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

Italian language code

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

German language code

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

Spanish language code

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

Spanish language code

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

Russian language code

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

Korean language code

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

Japanese language code

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

Hungarian language code

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

Portuguese language code

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

Arabic language code

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

Norwegian language code

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

Polish language code

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

Turkish language code

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

Ukrainian language code

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

Romanian language code

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

Bulgarian language code

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

Unknown language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:181
OS_IOS
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:188
OS_ANDROID
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:193
OS_WINDOWS
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:198
OS_MARMALADE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:203
OS_LINUX
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:208
OS_BADA
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:213
OS_BLACKBERRY
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:218
OS_OSX
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:223
OS_WP8
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:228
OS_WINRT
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:233
OS_UNKNOWN
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:238
UNKNOWN
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:244
WIN32
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:250
LINUX
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:256
MACOS
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:262
ANDROID
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:268
IPHONE
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:274
IPAD
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:280
BLACKBERRY
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:286
NACL
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:292
EMSCRIPTEN
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:298
TIZEN
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:304
WINRT
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:310
WP8
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:316
MOBILE_BROWSER
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:322
DESKTOP_BROWSER
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:328
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:335
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:342
WECHAT_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:349
QQ_PLAY
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:355
FB_PLAYABLE_ADS
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:361
BAIDU_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:367
VIVO_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:373
OPPO_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:379
BROWSER_TYPE_WECHAT

BROWSER_TYPE_WECHAT

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

BROWSER_TYPE_WECHAT_GAME

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

BROWSER_TYPE_WECHAT_GAME_SUB

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:399
BROWSER_TYPE_BAIDU_GAME

BROWSER_TYPE_BAIDU_GAME

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:406
BROWSER_TYPE_BAIDU_GAME_SUB

BROWSER_TYPE_BAIDU_GAME_SUB

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

BROWSER_TYPE_QQ_PLAY

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:420
BROWSER_TYPE_ANDROID
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:427
BROWSER_TYPE_IE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:434
BROWSER_TYPE_QQ
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:441
BROWSER_TYPE_MOBILE_QQ
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:448
BROWSER_TYPE_UC
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:455
BROWSER_TYPE_UCBS

uc third party integration.

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:462
BROWSER_TYPE_360
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:469
BROWSER_TYPE_BAIDU_APP
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:476
BROWSER_TYPE_BAIDU
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:483
BROWSER_TYPE_MAXTHON
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:490
BROWSER_TYPE_OPERA
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:497
BROWSER_TYPE_OUPENG
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:504
BROWSER_TYPE_MIUI
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:511
BROWSER_TYPE_FIREFOX
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:518
BROWSER_TYPE_SAFARI
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:525
BROWSER_TYPE_CHROME
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:532
BROWSER_TYPE_LIEBAO
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:539
BROWSER_TYPE_QZONE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:546
BROWSER_TYPE_SOUGOU
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:553
BROWSER_TYPE_UNKNOWN
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:560
isNative

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

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

Is web browser ?

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

Indicate whether system is mobile system

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

Indicate the running platform

meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:810
languageCode

Get current language iso 639-1 code. Examples of valid language codes include "zh-tw", "en", "en-us", "fr", "fr-fr", "es-es", etc. The actual value totally depends on results provided by destination platform.

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:825
language

Indicate the current language of the running system

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

Indicate the running os name

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

Indicate the running os version

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

Indicate the running os main version

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

Indicate the running browser type

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

Indicate the running browser version

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

Indicate the real pixel resolution of the whole game window

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

cc.sys.localStorage is a local storage component.

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

The capabilities of the current platform

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

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:1158
getBatteryLevel

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

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

Forces the garbage collection, only available in JSB

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

Restart the JS VM, only available in JSB

meta description
Defined in cocos2d/core/platform/CCSys.js:1194
getSafeAreaRect

Return the safe area rect.
only available on the iOS native platform, otherwise it will return a rect with design resolution size.

meta description
Returns Rect
Defined in cocos2d/core/platform/CCSys.js:1202
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:1216
Parameters
dump

Dump system informations

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

Open a url in browser

meta description
Defined in cocos2d/core/platform/CCSys.js:1250
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:1264

results matching ""

    No results matching ""