sys Class

Module: _decorator Parent Module: cc

System variables

Index

Properties
Methods
  • glExtension Is webgl extension support?
  • getMaxJointMatrixSize Get max joint matrix size for skinned mesh renderer.
  • 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:52
LANGUAGE_CHINESE

Chinese language code

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

French language code

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

Italian language code

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

German language code

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

Spanish language code

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

Spanish language code

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

Russian language code

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

Korean language code

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

Japanese language code

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

Hungarian language code

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

Portuguese language code

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

Arabic language code

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

Norwegian language code

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

Polish language code

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

Turkish language code

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

Ukrainian language code

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

Romanian language code

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

Bulgarian language code

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

Unknown language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:185
OS_IOS
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:192
OS_ANDROID
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:197
OS_WINDOWS
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:202
OS_MARMALADE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:207
OS_LINUX
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:212
OS_BADA
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:217
OS_BLACKBERRY
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:222
OS_OSX
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:227
OS_WP8
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:232
OS_WINRT
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:237
OS_UNKNOWN
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:242
UNKNOWN
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:248
WIN32
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:254
LINUX
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:260
MACOS
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:266
ANDROID
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:272
IPHONE
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:278
IPAD
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:284
BLACKBERRY
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:290
NACL
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:296
EMSCRIPTEN
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:302
TIZEN
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:308
WINRT
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:314
WP8
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:320
MOBILE_BROWSER
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:326
DESKTOP_BROWSER
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:332
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:339
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:346
WECHAT_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:353
QQ_PLAY
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:359
FB_PLAYABLE_ADS
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:365
BAIDU_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:371
VIVO_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:377
OPPO_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:383
HUAWEI_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:389
XIAOMI_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:395
JKW_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:401
BROWSER_TYPE_WECHAT

BROWSER_TYPE_WECHAT

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

BROWSER_TYPE_WECHAT_GAME

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

BROWSER_TYPE_WECHAT_GAME_SUB

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

BROWSER_TYPE_BAIDU_GAME

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

BROWSER_TYPE_BAIDU_GAME_SUB

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:435
BROWSER_TYPE_XIAOMI_GAME

BROWSER_TYPE_XIAOMI_GAME

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

BROWSER_TYPE_QQ_PLAY

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:449
BROWSER_TYPE_ANDROID
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:456
BROWSER_TYPE_IE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:463
BROWSER_TYPE_QQ
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:470
BROWSER_TYPE_MOBILE_QQ
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:477
BROWSER_TYPE_UC
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:484
BROWSER_TYPE_UCBS

uc third party integration.

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:491
BROWSER_TYPE_360
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:498
BROWSER_TYPE_BAIDU_APP
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:505
BROWSER_TYPE_BAIDU
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:512
BROWSER_TYPE_MAXTHON
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:519
BROWSER_TYPE_OPERA
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:526
BROWSER_TYPE_OUPENG
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:533
BROWSER_TYPE_MIUI
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:540
BROWSER_TYPE_FIREFOX
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:547
BROWSER_TYPE_SAFARI
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:554
BROWSER_TYPE_CHROME
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:561
BROWSER_TYPE_LIEBAO
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:568
BROWSER_TYPE_QZONE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:575
BROWSER_TYPE_SOUGOU
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:582
BROWSER_TYPE_UNKNOWN
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:589
isNative

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

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

Is web browser ?

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

Indicate whether system is mobile system

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

Indicate the running platform

meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:898
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:913
language

Indicate the current language of the running system

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

Indicate the running os name

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

Indicate the running os version

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

Indicate the running os main version

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

Indicate the running browser type

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

Indicate the running browser version

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

Indicate the real pixel resolution of the whole game window

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

cc.sys.localStorage is a local storage component.

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

The capabilities of the current platform

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

Methods

glExtension

Is webgl extension support?

meta description
Defined in cocos2d/core/platform/CCSys.js:610
Parameters
  • name Unknown
getMaxJointMatrixSize

Get max joint matrix size for skinned mesh renderer.

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

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

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

Forces the garbage collection, only available in JSB

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

Restart the JS VM, only available in JSB

meta description
Defined in cocos2d/core/platform/CCSys.js:1282
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:1290
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:1304
Parameters
dump

Dump system informations

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

Open a url in browser

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

results matching ""

    No results matching ""