sys Class

Module: cc Parent Module: cc

System variables

Index

Properties
Methods
  • glExtension Is webgl extension support?
  • getMaxJointMatrixSize Get max joint matrix size for skinned mesh renderer.
  • getSafeAreaRect Returns the safe area of the screen.
  • 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:53
LANGUAGE_CHINESE

Chinese language code

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

French language code

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

Italian language code

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

German language code

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

Spanish language code

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

Spanish language code

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

Russian language code

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

Korean language code

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

Japanese language code

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

Hungarian language code

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

Portuguese language code

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

Arabic language code

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

Norwegian language code

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

Polish language code

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

Turkish language code

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

Ukrainian language code

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

Romanian language code

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

Bulgarian language code

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

Unknown language code

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:186
OS_IOS
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:193
OS_ANDROID
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:198
OS_WINDOWS
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:203
OS_MARMALADE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:208
OS_LINUX
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:213
OS_BADA
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:218
OS_BLACKBERRY
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:223
OS_OSX
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:228
OS_WP8
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:233
OS_WINRT
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:238
OS_UNKNOWN
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:243
UNKNOWN
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:249
WIN32
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:255
LINUX
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:261
MACOS
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:267
ANDROID
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:273
IPHONE
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:279
IPAD
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:285
BLACKBERRY
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:291
NACL
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:297
EMSCRIPTEN
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:303
TIZEN
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:309
WINRT
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:315
WP8
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:321
MOBILE_BROWSER
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:327
DESKTOP_BROWSER
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:333
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:340
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:347
WECHAT_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:354
QQ_PLAY
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:360
FB_PLAYABLE_ADS
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:366
BAIDU_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:372
VIVO_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:378
OPPO_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:384
HUAWEI_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:390
XIAOMI_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:396
JKW_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:402
ALIPAY_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:408
WECHAT_GAME_SUB
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:414
BAIDU_GAME_SUB
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:420
QTT_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:426
BYTEDANCE_GAME
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:432
BYTEDANCE_GAME_SUB
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:438
LINKSURE
meta description
Type Number
Defined in cocos2d/core/platform/CCSys.js:444
BROWSER_TYPE_WECHAT

BROWSER_TYPE_WECHAT

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:450
BROWSER_TYPE_ANDROID
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:457
BROWSER_TYPE_IE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:464
BROWSER_TYPE_EDGE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:471
BROWSER_TYPE_QQ
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:478
BROWSER_TYPE_MOBILE_QQ
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:485
BROWSER_TYPE_UC
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:492
BROWSER_TYPE_UCBS

uc third party integration.

meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:499
BROWSER_TYPE_360
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:506
BROWSER_TYPE_BAIDU_APP
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:513
BROWSER_TYPE_BAIDU
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:520
BROWSER_TYPE_MAXTHON
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:527
BROWSER_TYPE_OPERA
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:534
BROWSER_TYPE_OUPENG
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:541
BROWSER_TYPE_MIUI
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:548
BROWSER_TYPE_FIREFOX
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:555
BROWSER_TYPE_SAFARI
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:562
BROWSER_TYPE_CHROME
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:569
BROWSER_TYPE_LIEBAO
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:576
BROWSER_TYPE_QZONE
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:583
BROWSER_TYPE_SOUGOU
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:590
BROWSER_TYPE_HUAWEI
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:597
BROWSER_TYPE_UNKNOWN
meta description
Type String
Defined in cocos2d/core/platform/CCSys.js:604
isNative

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

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

Is web browser ?

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

Indicate whether system is mobile system

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

Indicate the running platform

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

Indicate the current language of the running system

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

Indicate the running os name

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

Indicate the running os version

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

Indicate the running os main version

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

Indicate the running browser type

meta description
Type String | Null
Defined in cocos2d/core/platform/CCSys.js:869
browserVersion

Indicate the running browser version

meta description
Type String | Null
Defined in cocos2d/core/platform/CCSys.js:901
windowPixelResolution

Indicate the real pixel resolution of the whole game window

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

cc.sys.localStorage is a local storage component.

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

The capabilities of the current platform

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

Methods

glExtension

Is webgl extension support?

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

Get max joint matrix size for skinned mesh renderer.

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

Returns the safe area of the screen. If the screen is not notched, the design resolution will be returned by default. Only supported on Android, iOS and WeChat Mini Game platform.

meta description
Returns Rect
Defined in cocos2d/core/platform/CCSys.js:654
getNetworkType

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

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

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

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

Forces the garbage collection, only available in JSB

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

Restart the JS VM, only available in JSB

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

Dump system informations

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

Open a url in browser

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

results matching ""

    No results matching ""