Options
All
  • Public
  • Public/Protected
  • All
Menu

Class sys

System variables

Hierarchy

  • sys

Index

Properties

ANDROID

ANDROID: number = 3

ANDROID

BLACKBERRY

BLACKBERRY: number = 6

BLACKBERRY

BROWSER_TYPE_360

BROWSER_TYPE_360: string = "360browser"

BROWSER_TYPE_360

BROWSER_TYPE_ALIPAY_GAME

BROWSER_TYPE_ALIPAY_GAME: string = "alipaygame"

BROWSER_TYPE_ALIPAY_GAME

BROWSER_TYPE_ANDROID

BROWSER_TYPE_ANDROID: string = "androidbrowser"

BROWSER_TYPE_ANDROID

BROWSER_TYPE_BAIDU

BROWSER_TYPE_BAIDU: string = "baidubrowser"

BROWSER_TYPE_BAIDU

BROWSER_TYPE_BAIDU_APP

BROWSER_TYPE_BAIDU_APP: string = "baiduboxapp"

BROWSER_TYPE_BAIDU_APP

BROWSER_TYPE_BAIDU_GAME

BROWSER_TYPE_BAIDU_GAME: string = "baidugame"

BROWSER_TYPE_BAIDU_GAME

BROWSER_TYPE_CHROME

BROWSER_TYPE_CHROME: string = "chrome"

BROWSER_TYPE_CHROME

BROWSER_TYPE_COCOSPLAY

BROWSER_TYPE_COCOSPLAY: string = "cocosplay"

BROWSER_TYPE_COCOSPLAY

BROWSER_TYPE_FIREFOX

BROWSER_TYPE_FIREFOX: string = "firefox"

BROWSER_TYPE_FIREFOX

BROWSER_TYPE_IE

BROWSER_TYPE_IE: string = "ie"

BROWSER_TYPE_IE

BROWSER_TYPE_LIEBAO

BROWSER_TYPE_LIEBAO: string = "liebao"

BROWSER_TYPE_LIEBAO

BROWSER_TYPE_MAXTHON

BROWSER_TYPE_MAXTHON: string = "maxthon"

BROWSER_TYPE_MAXTHON

BROWSER_TYPE_MIUI

BROWSER_TYPE_MIUI: string = "miuibrowser"

BROWSER_TYPE_MIUI

BROWSER_TYPE_MOBILE_QQ

BROWSER_TYPE_MOBILE_QQ: string = "mqqbrowser"

BROWSER_TYPE_MOBILE_QQ

BROWSER_TYPE_OPERA

BROWSER_TYPE_OPERA: string = "opera"

BROWSER_TYPE_OPERA

BROWSER_TYPE_OUPENG

BROWSER_TYPE_OUPENG: string = "oupeng"

BROWSER_TYPE_OUPENG

BROWSER_TYPE_QQ

BROWSER_TYPE_QQ: string = "qqbrowser"

BROWSER_TYPE_QQ

BROWSER_TYPE_QZONE

BROWSER_TYPE_QZONE: string = "qzone"

BROWSER_TYPE_QZONE

BROWSER_TYPE_SAFARI

BROWSER_TYPE_SAFARI: string = "safari"

BROWSER_TYPE_SAFARI

BROWSER_TYPE_SOUGOU

BROWSER_TYPE_SOUGOU: string = "sogou"

BROWSER_TYPE_SOUGOU

BROWSER_TYPE_UC

BROWSER_TYPE_UC: string = "ucbrowser"

BROWSER_TYPE_UC

BROWSER_TYPE_UCBS

BROWSER_TYPE_UCBS: string = "ucbs"

uc third party integration.

BROWSER_TYPE_UNKNOWN

BROWSER_TYPE_UNKNOWN: string = "unknown"

BROWSER_TYPE_UNKNOWN

BROWSER_TYPE_WECHAT

BROWSER_TYPE_WECHAT: string = "wechat"

BROWSER_TYPE_WECHAT

BROWSER_TYPE_WECHAT_GAME

BROWSER_TYPE_WECHAT_GAME: string = "wechatgame"

BROWSER_TYPE_WECHAT_GAME

BROWSER_TYPE_XIAOMI_GAME

BROWSER_TYPE_XIAOMI_GAME: string = "xiaomiquickgame"

BROWSER_TYPE_XIAOMI_GAME

DESKTOP_BROWSER

DESKTOP_BROWSER: number = 101

DESKTOP_BROWSER

EDITOR_CORE

EDITOR_CORE: number = 103

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

EDITOR_PAGE

EDITOR_PAGE: number = 102

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

EMSCRIPTEN

EMSCRIPTEN: number = 8

EMSCRIPTEN

IPAD

IPAD: number = 5

IPAD

IPHONE

IPHONE: number = 4

IPHONE

LANGUAGE_ARABIC

LANGUAGE_ARABIC: string = "ar"

Arabic language code

LANGUAGE_BULGARIAN

LANGUAGE_BULGARIAN: string = "bg"

Bulgarian language code

LANGUAGE_CHINESE

LANGUAGE_CHINESE: string = "zh"

Chinese language code

LANGUAGE_DUTCH

LANGUAGE_DUTCH: string = "du"

Spanish language code

LANGUAGE_ENGLISH

LANGUAGE_ENGLISH: string = "en"

English language code

LANGUAGE_FRENCH

LANGUAGE_FRENCH: string = "fr"

French language code

LANGUAGE_GERMAN

LANGUAGE_GERMAN: string = "de"

German language code

LANGUAGE_HUNGARIAN

LANGUAGE_HUNGARIAN: string = "hu"

Hungarian language code

LANGUAGE_ITALIAN

LANGUAGE_ITALIAN: string = "it"

Italian language code

LANGUAGE_JAPANESE

LANGUAGE_JAPANESE: string = "ja"

Japanese language code

LANGUAGE_KOREAN

LANGUAGE_KOREAN: string = "ko"

Korean language code

LANGUAGE_NORWEGIAN

LANGUAGE_NORWEGIAN: string = "no"

Norwegian language code

LANGUAGE_POLISH

LANGUAGE_POLISH: string = "pl"

Polish language code

LANGUAGE_PORTUGUESE

LANGUAGE_PORTUGUESE: string = "pt"

Portuguese language code

LANGUAGE_ROMANIAN

LANGUAGE_ROMANIAN: string = "ro"

Romanian language code

LANGUAGE_RUSSIAN

LANGUAGE_RUSSIAN: string = "ru"

Russian language code

LANGUAGE_SPANISH

LANGUAGE_SPANISH: string = "es"

Spanish language code

LANGUAGE_TURKISH

LANGUAGE_TURKISH: string = "tr"

Turkish language code

LANGUAGE_UKRAINIAN

LANGUAGE_UKRAINIAN: string = "uk"

Ukrainian language code

LANGUAGE_UNKNOWN

LANGUAGE_UNKNOWN: string = "unknown"

Unknown language code

LINUX

LINUX: number = 1

LINUX

MACOS

MACOS: number = 2

MACOS

MOBILE_BROWSER

MOBILE_BROWSER: number = 100

MOBILE_BROWSER

NACL

NACL: number = 7

NACL

OS_ANDROID

OS_ANDROID: string = "Android"

OS_ANDROID

OS_BADA

OS_BADA: string = "Bada"

OS_BADA

OS_BLACKBERRY

OS_BLACKBERRY: string = "Blackberry"

OS_BLACKBERRY

OS_IOS

OS_IOS: string = "iOS"

OS_IOS

OS_LINUX

OS_LINUX: string = "Linux"

OS_LINUX

OS_MARMALADE

OS_MARMALADE: string = "Marmalade"

OS_MARMALADE

OS_OSX

OS_OSX: string = "OS X"

OS_OSX

OS_UNKNOWN

OS_UNKNOWN: string = "Unknown"

OS_UNKNOWN

OS_WINDOWS

OS_WINDOWS: string = "Windows"

OS_WINDOWS

OS_WINRT

OS_WINRT: string = "WINRT"

OS_WINRT

OS_WP8

OS_WP8: string = "WP8"

OS_WP8

QQ_PLAY

QQ_PLAY: number = 105

QQ_PLAY

TIZEN

TIZEN: number = 9

TIZEN

UNKNOWN

UNKNOWN: number = -1

UNKNOWN

WECHAT_GAME

WECHAT_GAME: number = 104

WECHAT_GAME

WIN32

WIN32: number = 0

WIN32

WINRT

WINRT: number = 10

WINRT

WP8

WP8: number = 11

WP8

browserType

browserType: any = sys.BROWSER_TYPE_UNKNOWN

Indicate the running browser type

browserVersion

browserVersion: string = ""

Indicate the running browser version

isBrowser

isBrowser: boolean = typeof window === 'object' && typeof document === 'object' && !CC_MINIGAME && !CC_JSB

Is web browser ?

isLittleEndian

isLittleEndian: boolean = (() => {const buffer = new ArrayBuffer(2);new DataView(buffer).setInt16(0, 256, true);// Int16Array uses the platform's endianness.return new Int16Array(buffer)[0] === 256;})()

Endianess of current platform

isMobile

isMobile: boolean = /mobile|android|iphone|ipad/.test(ua)

Indicate whether system is mobile system

isNative

isNative: boolean = CC_JSB

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

language

language: any = currLanguage

Indicate the current language of the running system

os

os: any = osName

Indicate the running os name

osMainVersion

osMainVersion: any = osMainVersion

Indicate the running os main version

osVersion

osVersion: any = osVersion

Indicate the running os version

platform

platform: any = sys.isMobile ? sys.MOBILE_BROWSER : sys.DESKTOP_BROWSER

Indicate the running platform

Methods

cleanScript

  • cleanScript(jsfile: any): void

dump

  • dump(): void

dumpRoot

  • dumpRoot(): void

garbageCollect

  • garbageCollect(): void

getBatteryLevel

  • getBatteryLevel(): number

getNetworkType

  • getNetworkType(): any
  • 获取当前设备的网络类型, 如果网络类型无法获取,默认将返回 cc.sys.NetworkType.LAN

    Returns any

isObjectValid

  • isObjectValid(obj: any): boolean
  • 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

    Parameters

    • obj: any

    Returns boolean

now

  • now(): number

openURL

  • openURL(url: any): void

restartVM

  • restartVM(): void

Object literals

NetworkType

NetworkType: object

网络类型枚举

LAN

LAN: number = 1

通过无线或者有线本地网络连接因特网

NONE

NONE: number = 0

网络不通

WWAN

WWAN: number = 2

通过蜂窝移动网络连接因特网

windowPixelResolution

windowPixelResolution: object

Indicate the real pixel resolution of the whole game window

height

height: number = ratio * h

width

width: number = ratio * w

Generated using TypeDoc