Const macro
macro: object
CLEANUP_IMAGE_CACHE
CLEANUP_IMAGE_CACHE: boolean = false
DEG
DEG: number = 180 / Math.PI
ENABLE_MULTI_TOUCH
ENABLE_MULTI_TOUCH: boolean = true
ENABLE_TILEDMAP_CULLING
ENABLE_TILEDMAP_CULLING: boolean = true
ENABLE_TRANSPARENT_CANVAS
ENABLE_TRANSPARENT_CANVAS: boolean = false
ENABLE_WEBGL_ANTIALIAS
ENABLE_WEBGL_ANTIALIAS: boolean = true
FLT_EPSILON
FLT_EPSILON: number = 1.192092896e-7
KEY
KEY: { *: number; +: number; ,: number; -: number; .: number; /: number; 0: number; 1: number; 2: number; 3: number; 4: number; 5: number; 6: number; 7: number; 8: number; 9: number; ;: number; =: number; Delete: number; [: number; ]: number; a: number; alt: number; b: number; back: number; backslash: number; backspace: number; c: number; capslock: number; closebracket: number; comma: number; ctrl: number; d: number; dash: number; down: number; dpadCenter: number; dpadDown: number; dpadLeft: number; dpadRight: number; dpadUp: number; e: number; end: number; enter: number; equal: number; escape: number; f: number; f1: number; f10: number; f11: number; f12: number; f2: number; f3: number; f4: number; f5: number; f6: number; f7: number; f8: number; f9: number; forwardslash: number; g: number; grave: number; h: number; home: number; i: number; insert: number; j: number; k: number; l: number; left: number; m: number; menu: number; n: number; none: number; num0: number; num1: number; num2: number; num3: number; num4: number; num5: number; num6: number; num7: number; num8: number; num9: number; numdel: number; numlock: number; o: number; openbracket: number; p: number; pagedown: number; pageup: number; pause: number; period: number; q: number; quote: number; r: number; right: number; s: number; scrolllock: number; select: number; semicolon: number; shift: number; space: number; t: number; tab: number; u: number; up: number; v: number; w: number; x: number; y: number; z: number }
MAX_LABEL_CANVAS_POOL_SIZE
MAX_LABEL_CANVAS_POOL_SIZE: number = 20
ORIENTATION_AUTO
ORIENTATION_AUTO: number = 3
ORIENTATION_LANDSCAPE
ORIENTATION_LANDSCAPE: number = 2
ORIENTATION_PORTRAIT
ORIENTATION_PORTRAIT: number = 1
RAD
RAD: number = Math.PI / 180
REPEAT_FOREVER
REPEAT_FOREVER: number = (Number.MAX_VALUE - 1)
SUPPORT_TEXTURE_FORMATS
SUPPORT_TEXTURE_FORMATS: string[]
TOUCH_TIMEOUT
TOUCH_TIMEOUT: number = 5000
Const screen
screen: object
_fn
_fn: any = null as any
_fnMap
_fnMap: string[][] = [['requestFullscreen','exitFullscreen','fullscreenchange','fullscreenEnabled','fullscreenElement',],['requestFullScreen','exitFullScreen','fullScreenchange','fullScreenEnabled','fullScreenElement',],['webkitRequestFullScreen','webkitCancelFullScreen','webkitfullscreenchange','webkitIsFullScreen','webkitCurrentFullScreenElement',],['mozRequestFullScreen','mozCancelFullScreen','mozfullscreenchange','mozFullScreen','mozFullScreenElement',],['msRequestFullscreen','msExitFullscreen','MSFullscreenChange','msFullscreenEnabled','msFullscreenElement',],]
_onfullscreenchange
_onfullscreenchange: any = null as any
_onfullscreenerror
_onfullscreenerror: any = null as any
_preOnFullScreenError
_preOnFullScreenError: any = null as any
_preOnTouch
_preOnTouch: any = null as any
_supportsFullScreen
_supportsFullScreen: boolean = false
_touchEvent
_touchEvent: string = ""
ensureFullScreen
- ensureFullScreen(element: HTMLElement, onFullScreenChange: (this: Document, ev: any) => any): void
-
Parameters
-
element: HTMLElement
-
onFullScreenChange: (this: Document, ev: any) => any
-
- (this: Document, ev: any): any
Returns void
autoFullScreen
- autoFullScreen(element: HTMLElement, onFullScreenChange: (this: Document, ev: any) => any): void
-
Parameters
-
element: HTMLElement
-
onFullScreenChange: (this: Document, ev: any) => any
-
- (this: Document, ev: any): any
Returns void
disableAutoFullScreen
- disableAutoFullScreen(element: any): void
exitFullScreen
- exitFullScreen(): Promise<any> | undefined
-
Returns Promise<any> | undefined
requestFullScreen
- requestFullScreen(element: HTMLElement, onFullScreenChange?: undefined | ((this: Document, ev: any) => any), onFullScreenError?: undefined | ((this: Document, ev: any) => any)): Promise<any> | undefined
-
Parameters
-
element: HTMLElement
-
Optional onFullScreenChange: undefined | ((this: Document, ev: any) => any)
-
Optional onFullScreenError: undefined | ((this: Document, ev: any) => any)
Returns Promise<any> | undefined
supportsFullScreen
- get supportsFullScreen(): boolean
Const sys
sys: object
ALIPAY_MINI_GAME
ALIPAY_MINI_GAME: number = 113
ANDROID
ANDROID: number = 3
BAIDU_MINI_GAME
BAIDU_MINI_GAME: number = 107
BLACKBERRY
BLACKBERRY: number = 6
BROWSER_TYPE_360
BROWSER_TYPE_360: string = "360browser"
BROWSER_TYPE_ANDROID
BROWSER_TYPE_ANDROID: string = "androidbrowser"
BROWSER_TYPE_BAIDU
BROWSER_TYPE_BAIDU: string = "baidubrowser"
BROWSER_TYPE_BAIDU_APP
BROWSER_TYPE_BAIDU_APP: string = "baiduboxapp"
BROWSER_TYPE_CHROME
BROWSER_TYPE_CHROME: string = "chrome"
BROWSER_TYPE_EDGE
BROWSER_TYPE_EDGE: string = "edge"
BROWSER_TYPE_FIREFOX
BROWSER_TYPE_FIREFOX: string = "firefox"
BROWSER_TYPE_HUAWEI
BROWSER_TYPE_HUAWEI: string = "huawei"
BROWSER_TYPE_IE
BROWSER_TYPE_IE: string = "ie"
BROWSER_TYPE_LIEBAO
BROWSER_TYPE_LIEBAO: string = "liebao"
BROWSER_TYPE_MAXTHON
BROWSER_TYPE_MAXTHON: string = "maxthon"
BROWSER_TYPE_MIUI
BROWSER_TYPE_MIUI: string = "miuibrowser"
BROWSER_TYPE_MOBILE_QQ
BROWSER_TYPE_MOBILE_QQ: string = "mqqbrowser"
BROWSER_TYPE_OPERA
BROWSER_TYPE_OPERA: string = "opera"
BROWSER_TYPE_OUPENG
BROWSER_TYPE_OUPENG: string = "oupeng"
BROWSER_TYPE_QQ
BROWSER_TYPE_QQ: string = "qqbrowser"
BROWSER_TYPE_QZONE
BROWSER_TYPE_QZONE: string = "qzone"
BROWSER_TYPE_SAFARI
BROWSER_TYPE_SAFARI: string = "safari"
BROWSER_TYPE_SOUGOU
BROWSER_TYPE_SOUGOU: string = "sogou"
BROWSER_TYPE_UC
BROWSER_TYPE_UC: string = "ucbrowser"
BROWSER_TYPE_UCBS
BROWSER_TYPE_UCBS: string = "ucbs"
BROWSER_TYPE_UNKNOWN
BROWSER_TYPE_UNKNOWN: string = "unknown"
BROWSER_TYPE_WECHAT
BROWSER_TYPE_WECHAT: string = "wechat"
BYTEDANCE_MINI_GAME
BYTEDANCE_MINI_GAME: number = 117
COCOSPLAY
COCOSPLAY: number = 112
DESKTOP_BROWSER
DESKTOP_BROWSER: number = 101
EDITOR_CORE
EDITOR_CORE: number = 103
EDITOR_PAGE
EDITOR_PAGE: number = 102
EMSCRIPTEN
EMSCRIPTEN: number = 8
FB_PLAYABLE_ADS
FB_PLAYABLE_ADS: number = 106
HUAWEI_QUICK_GAME
HUAWEI_QUICK_GAME: number = 110
IPHONE
IPHONE: number = 4
LANGUAGE_ARABIC
LANGUAGE_ARABIC: string = "ar"
LANGUAGE_BULGARIAN
LANGUAGE_BULGARIAN: string = "bg"
LANGUAGE_CHINESE
LANGUAGE_CHINESE: string = "zh"
LANGUAGE_DUTCH
LANGUAGE_DUTCH: string = "du"
LANGUAGE_ENGLISH
LANGUAGE_ENGLISH: string = "en"
LANGUAGE_FRENCH
LANGUAGE_FRENCH: string = "fr"
LANGUAGE_GERMAN
LANGUAGE_GERMAN: string = "de"
LANGUAGE_HUNGARIAN
LANGUAGE_HUNGARIAN: string = "hu"
LANGUAGE_ITALIAN
LANGUAGE_ITALIAN: string = "it"
LANGUAGE_JAPANESE
LANGUAGE_JAPANESE: string = "ja"
LANGUAGE_KOREAN
LANGUAGE_KOREAN: string = "ko"
LANGUAGE_NORWEGIAN
LANGUAGE_NORWEGIAN: string = "no"
LANGUAGE_POLISH
LANGUAGE_POLISH: string = "pl"
LANGUAGE_PORTUGUESE
LANGUAGE_PORTUGUESE: string = "pt"
LANGUAGE_ROMANIAN
LANGUAGE_ROMANIAN: string = "ro"
LANGUAGE_RUSSIAN
LANGUAGE_RUSSIAN: string = "ru"
LANGUAGE_SPANISH
LANGUAGE_SPANISH: string = "es"
LANGUAGE_TURKISH
LANGUAGE_TURKISH: string = "tr"
LANGUAGE_UKRAINIAN
LANGUAGE_UKRAINIAN: string = "uk"
LANGUAGE_UNKNOWN
LANGUAGE_UNKNOWN: string = "unknown"
LINKSURE_MINI_GAME
LINKSURE_MINI_GAME: number = 119
MOBILE_BROWSER
MOBILE_BROWSER: number = 100
OPPO_MINI_GAME
OPPO_MINI_GAME: number = 109
OS_ANDROID
OS_ANDROID: string = "Android"
OS_IOS
OS_IOS: string = "iOS"
OS_LINUX
OS_LINUX: string = "Linux"
OS_OSX
OS_OSX: string = "OS X"
OS_UNKNOWN
OS_UNKNOWN: string = "Unknown"
OS_WINDOWS
OS_WINDOWS: string = "Windows"
QQ_PLAY
QQ_PLAY: number = 105
QTT_MINI_GAME
QTT_MINI_GAME: number = 116
UNKNOWN
UNKNOWN: number = -1
VIVO_MINI_GAME
VIVO_MINI_GAME: number = 108
WECHAT_GAME
WECHAT_GAME: number = 104
XIAOMI_QUICK_GAME
XIAOMI_QUICK_GAME: number = 111
Private __audioSupport
__audioSupport: null = null
Private __videoSupport
__videoSupport: null = null
browserType
browserType: string = "unknown"
browserVersion
browserVersion: string = ""
capabilities
capabilities: null = null
isBrowser
isBrowser: boolean = typeof window === 'object' && typeof document === 'object'
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;})()
isMobile
isMobile: boolean = false
isNative
isNative: boolean = false
language
language: string = "unknown"
languageCode
languageCode: string = "unknown"
localStorage
localStorage: null = null
os
os: string = "Unknown"
osMainVersion
osMainVersion: number = 0
osVersion
osVersion: string = ""
platform
platform: number = -1
windowPixelResolution
windowPixelResolution: null = null
getBatteryLevel
- getBatteryLevel(): number
isObjectValid
- isObjectValid(obj: any): boolean
-
Parameters
Returns boolean
!en Emit when design resolution changed. !zh 当设计分辨率改变时发送。