- sys 类型
- Details
- 属性(properties)
- LANGUAGE_ENGLISH
- LANGUAGE_CHINESE
- LANGUAGE_FRENCH
- LANGUAGE_ITALIAN
- LANGUAGE_GERMAN
- LANGUAGE_SPANISH
- LANGUAGE_DUTCH
- LANGUAGE_RUSSIAN
- LANGUAGE_KOREAN
- LANGUAGE_JAPANESE
- LANGUAGE_HUNGARIAN
- LANGUAGE_PORTUGUESE
- LANGUAGE_ARABIC
- LANGUAGE_NORWEGIAN
- LANGUAGE_POLISH
- LANGUAGE_TURKISH
- LANGUAGE_UKRAINIAN
- LANGUAGE_ROMANIAN
- LANGUAGE_BULGARIAN
- LANGUAGE_UNKNOWN
- OS_IOS
- OS_ANDROID
- OS_WINDOWS
- OS_MARMALADE
- OS_LINUX
- OS_BADA
- OS_BLACKBERRY
- OS_OSX
- OS_WP8
- OS_WINRT
- OS_UNKNOWN
- UNKNOWN
- WIN32
- LINUX
- MACOS
- ANDROID
- IPHONE
- IPAD
- BLACKBERRY
- NACL
- EMSCRIPTEN
- TIZEN
- WINRT
- WP8
- MOBILE_BROWSER
- DESKTOP_BROWSER
- EDITOR_PAGE
- EDITOR_CORE
- WECHAT_GAME
- QQ_PLAY
- FB_PLAYABLE_ADS
- BROWSER_TYPE_WECHAT
- BROWSER_TYPE_WECHAT_GAME
- BROWSER_TYPE_WECHAT_GAME_SUB
- BROWSER_TYPE_QQ_PLAY
- BROWSER_TYPE_ANDROID
- BROWSER_TYPE_IE
- BROWSER_TYPE_QQ
- BROWSER_TYPE_MOBILE_QQ
- BROWSER_TYPE_UC
- BROWSER_TYPE_UCBS
- BROWSER_TYPE_360
- BROWSER_TYPE_BAIDU_APP
- BROWSER_TYPE_BAIDU
- BROWSER_TYPE_MAXTHON
- BROWSER_TYPE_OPERA
- BROWSER_TYPE_OUPENG
- BROWSER_TYPE_MIUI
- BROWSER_TYPE_FIREFOX
- BROWSER_TYPE_SAFARI
- BROWSER_TYPE_CHROME
- BROWSER_TYPE_LIEBAO
- BROWSER_TYPE_QZONE
- BROWSER_TYPE_SOUGOU
- BROWSER_TYPE_UNKNOWN
- isNative
- isBrowser
- isMobile
- platform
- language
- os
- osVersion
- osMainVersion
- browserType
- browserVersion
- windowPixelResolution
- localStorage
- capabilities
- getBatteryLevel
- garbageCollect
- restartVM
- getSafeAreaRect
- isObjectValid
- dump
- openURL
- now
- 属性(properties)
sys 类型
模块: _decorator父模块: cc
System variables
索引
属性(properties)
LANGUAGE_ENGLISH
String
English language codeLANGUAGE_CHINESE
String
Chinese language codeLANGUAGE_FRENCH
String
French language codeLANGUAGE_ITALIAN
String
Italian language codeLANGUAGE_GERMAN
String
German language codeLANGUAGE_SPANISH
String
Spanish language codeLANGUAGE_DUTCH
String
Spanish language codeLANGUAGE_RUSSIAN
String
Russian language codeLANGUAGE_KOREAN
String
Korean language codeLANGUAGE_JAPANESE
String
Japanese language codeLANGUAGE_HUNGARIAN
String
Hungarian language codeLANGUAGE_PORTUGUESE
String
Portuguese language codeLANGUAGE_ARABIC
String
Arabic language codeLANGUAGE_NORWEGIAN
String
Norwegian language codeLANGUAGE_POLISH
String
Polish language codeLANGUAGE_TURKISH
String
Turkish language codeLANGUAGE_UKRAINIAN
String
Ukrainian language codeLANGUAGE_ROMANIAN
String
Romanian language codeLANGUAGE_BULGARIAN
String
Bulgarian language codeLANGUAGE_UNKNOWN
String
Unknown language codeOS_IOS
String
OS_ANDROID
String
OS_WINDOWS
String
OS_MARMALADE
String
OS_LINUX
String
OS_BADA
String
OS_BLACKBERRY
String
OS_OSX
String
OS_WP8
String
OS_WINRT
String
OS_UNKNOWN
String
UNKNOWN
Number
WIN32
Number
LINUX
Number
MACOS
Number
ANDROID
Number
IPHONE
Number
IPAD
Number
BLACKBERRY
Number
NACL
Number
EMSCRIPTEN
Number
TIZEN
Number
WINRT
Number
WP8
Number
MOBILE_BROWSER
Number
DESKTOP_BROWSER
Number
EDITOR_PAGE
Number
Indicates whether executes in editor's window process (Electron's renderer context)EDITOR_CORE
Number
Indicates whether executes in editor's main process (Electron's browser context)WECHAT_GAME
Number
QQ_PLAY
Number
FB_PLAYABLE_ADS
Number
BROWSER_TYPE_WECHAT
String
BROWSER_TYPE_WECHATBROWSER_TYPE_WECHAT_GAME
String
BROWSER_TYPE_WECHAT_GAMEBROWSER_TYPE_WECHAT_GAME_SUB
String
BROWSER_TYPE_WECHAT_GAME_SUBBROWSER_TYPE_QQ_PLAY
String
BROWSER_TYPE_QQ_PLAYBROWSER_TYPE_ANDROID
String
BROWSER_TYPE_IE
String
BROWSER_TYPE_QQ
String
BROWSER_TYPE_MOBILE_QQ
String
BROWSER_TYPE_UC
String
BROWSER_TYPE_UCBS
String
uc third party integration.BROWSER_TYPE_360
String
BROWSER_TYPE_BAIDU_APP
String
BROWSER_TYPE_BAIDU
String
BROWSER_TYPE_MAXTHON
String
BROWSER_TYPE_OPERA
String
BROWSER_TYPE_OUPENG
String
BROWSER_TYPE_MIUI
String
BROWSER_TYPE_FIREFOX
String
BROWSER_TYPE_SAFARI
String
BROWSER_TYPE_CHROME
String
BROWSER_TYPE_LIEBAO
String
BROWSER_TYPE_QZONE
String
BROWSER_TYPE_SOUGOU
String
BROWSER_TYPE_UNKNOWN
String
isNative
Boolean
Is native ? This is set to be true in jsb auto.isBrowser
Boolean
Is web browser ?isMobile
Boolean
Indicate whether system is mobile systemplatform
Number
Indicate the running platformlanguage
String
Indicate the current language of the running systemos
String
Indicate the running os nameosVersion
String
Indicate the running os versionosMainVersion
Number
Indicate the running os main versionbrowserType
String
Indicate the running browser typebrowserVersion
String
Indicate the running browser versionwindowPixelResolution
Size
Indicate the real pixel resolution of the whole game windowlocalStorage
Object
cc.sys.localStorage is a local storage component.capabilities
Object
The capabilities of the current platform
方法
getNetworkType
获取当前设备的网络类型, 如果网络类型无法获取,默认将返回 cc.sys.NetworkType.LANgetBatteryLevel
获取当前设备的电池电量,如果电量无法获取,默认将返回 1garbageCollect
Forces the garbage collection, only available in JSBrestartVM
Restart the JS VM, only available in JSBgetSafeAreaRect
返回手机屏幕安全区域,目前仅在 iOS 原生平台有效。isObjectValid
In web engine, it will return true if the object existdump
Dump system informationsopenURL
Open a url in browsernow
Get the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
Details
属性(properties)
LANGUAGE_ENGLISH
English language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:40 |
LANGUAGE_CHINESE
Chinese language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:47 |
LANGUAGE_FRENCH
French language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:54 |
LANGUAGE_ITALIAN
Italian language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:61 |
LANGUAGE_GERMAN
German language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:68 |
LANGUAGE_SPANISH
Spanish language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:75 |
LANGUAGE_DUTCH
Spanish language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:82 |
LANGUAGE_RUSSIAN
Russian language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:89 |
LANGUAGE_KOREAN
Korean language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:96 |
LANGUAGE_JAPANESE
Japanese language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:103 |
LANGUAGE_HUNGARIAN
Hungarian language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:110 |
LANGUAGE_PORTUGUESE
Portuguese language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:117 |
LANGUAGE_ARABIC
Arabic language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:124 |
LANGUAGE_NORWEGIAN
Norwegian language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:131 |
LANGUAGE_POLISH
Polish language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:138 |
LANGUAGE_TURKISH
Turkish language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:145 |
LANGUAGE_UKRAINIAN
Ukrainian language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:152 |
LANGUAGE_ROMANIAN
Romanian language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:159 |
LANGUAGE_BULGARIAN
Bulgarian language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:166 |
LANGUAGE_UNKNOWN
Unknown language code
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:173 |
OS_IOS
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:180 |
OS_ANDROID
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:185 |
OS_WINDOWS
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:190 |
OS_MARMALADE
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:195 |
OS_LINUX
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:200 |
OS_BADA
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:205 |
OS_BLACKBERRY
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:210 |
OS_OSX
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:215 |
OS_WP8
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:220 |
OS_WINRT
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:225 |
OS_UNKNOWN
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:230 |
UNKNOWN
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:236 |
WIN32
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:242 |
LINUX
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:248 |
MACOS
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:254 |
ANDROID
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:260 |
IPHONE
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:266 |
IPAD
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:272 |
BLACKBERRY
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:278 |
NACL
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:284 |
EMSCRIPTEN
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:290 |
TIZEN
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:296 |
WINRT
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:302 |
WP8
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:308 |
MOBILE_BROWSER
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:314 |
DESKTOP_BROWSER
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:320 |
EDITOR_PAGE
Indicates whether executes in editor's window process (Electron's renderer context)
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:327 |
EDITOR_CORE
Indicates whether executes in editor's main process (Electron's browser context)
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:334 |
WECHAT_GAME
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:341 |
QQ_PLAY
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:347 |
FB_PLAYABLE_ADS
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:353 |
BROWSER_TYPE_WECHAT
BROWSER_TYPE_WECHAT
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:359 |
BROWSER_TYPE_WECHAT_GAME
BROWSER_TYPE_WECHAT_GAME
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:366 |
BROWSER_TYPE_WECHAT_GAME_SUB
BROWSER_TYPE_WECHAT_GAME_SUB
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:373 |
BROWSER_TYPE_QQ_PLAY
BROWSER_TYPE_QQ_PLAY
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:380 |
BROWSER_TYPE_ANDROID
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:387 |
BROWSER_TYPE_IE
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:394 |
BROWSER_TYPE_QQ
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:401 |
BROWSER_TYPE_MOBILE_QQ
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:408 |
BROWSER_TYPE_UC
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:415 |
BROWSER_TYPE_UCBS
uc third party integration.
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:422 |
BROWSER_TYPE_360
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:429 |
BROWSER_TYPE_BAIDU_APP
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:436 |
BROWSER_TYPE_BAIDU
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:443 |
BROWSER_TYPE_MAXTHON
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:450 |
BROWSER_TYPE_OPERA
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:457 |
BROWSER_TYPE_OUPENG
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:464 |
BROWSER_TYPE_MIUI
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:471 |
BROWSER_TYPE_FIREFOX
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:478 |
BROWSER_TYPE_SAFARI
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:485 |
BROWSER_TYPE_CHROME
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:492 |
BROWSER_TYPE_LIEBAO
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:499 |
BROWSER_TYPE_QZONE
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:506 |
BROWSER_TYPE_SOUGOU
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:513 |
BROWSER_TYPE_UNKNOWN
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:520 |
isNative
Is native ? This is set to be true in jsb auto.
meta | description |
---|---|
类型 | Boolean |
定义于 | cocos2d/core/platform/CCSys.js:528 |
isBrowser
Is web browser ?
meta | description |
---|---|
类型 | Boolean |
定义于 | cocos2d/core/platform/CCSys.js:535 |
isMobile
Indicate whether system is mobile system
meta | description |
---|---|
类型 | Boolean |
定义于 | cocos2d/core/platform/CCSys.js:720 |
platform
Indicate the running platform
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:726 |
language
Indicate the current language of the running system
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:742 |
os
Indicate the running os name
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:776 |
osVersion
Indicate the running os version
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:781 |
osMainVersion
Indicate the running os main version
meta | description |
---|---|
类型 | Number |
定义于 | cocos2d/core/platform/CCSys.js:786 |
browserType
Indicate the running browser type
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:792 |
browserVersion
Indicate the running browser version
meta | description |
---|---|
类型 | String |
定义于 | cocos2d/core/platform/CCSys.js:829 |
windowPixelResolution
Indicate the real pixel resolution of the whole game window
meta | description |
---|---|
类型 | Size |
定义于 | cocos2d/core/platform/CCSys.js:847 |
localStorage
cc.sys.localStorage is a local storage component.
meta | description |
---|---|
类型 | Object |
定义于 | cocos2d/core/platform/CCSys.js:880 |
capabilities
The capabilities of the current platform
meta | description |
---|---|
类型 | Object |
定义于 | cocos2d/core/platform/CCSys.js:914 |
#### 方法
##### getNetworkType
获取当前设备的网络类型, 如果网络类型无法获取,默认将返回 cc.sys.NetworkType.LAN
meta | description |
---|---|
返回 | NetworkType |
定义于 | cocos2d/core/platform/CCSys.js:1065 |
getBatteryLevel
获取当前设备的电池电量,如果电量无法获取,默认将返回 1
meta | description |
---|---|
返回 | Number |
定义于 | cocos2d/core/platform/CCSys.js:1079 |
garbageCollect
Forces the garbage collection, only available in JSB
meta | description |
---|---|
定义于 | cocos2d/core/platform/CCSys.js:1093 |
restartVM
Restart the JS VM, only available in JSB
meta | description |
---|---|
定义于 | cocos2d/core/platform/CCSys.js:1101 |
getSafeAreaRect
返回手机屏幕安全区域,目前仅在 iOS 原生平台有效。其它平台将默认返回设计分辨率尺寸。
meta | description |
---|---|
返回 | Rect |
定义于 | cocos2d/core/platform/CCSys.js:1109 |
isObjectValid
Check whether an object is valid,In web engine, it will return true if the object existIn native engine, it will return true if the JS object and the correspond native object are both valid
meta | description |
---|---|
返回 | Boolean |
定义于 | cocos2d/core/platform/CCSys.js:1123 |
参数列表
obj
Object
dump
Dump system informations
meta | description |
---|---|
定义于 | cocos2d/core/platform/CCSys.js:1138 |
openURL
Open a url in browser
meta | description |
---|---|
定义于 | cocos2d/core/platform/CCSys.js:1157 |
参数列表
url
String
now
Get the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
meta | description |
---|---|
返回 | Number |
定义于 | cocos2d/core/platform/CCSys.js:1171 |