Cocos Creator API

1.0.0

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

sys

Module: cc

System variables

Properties

LANGUAGE_ENGLISH String readOnly

English language code

LANGUAGE_CHINESE String readOnly

Chinese language code

LANGUAGE_FRENCH String readOnly

French language code

LANGUAGE_ITALIAN String readOnly

Italian language code

LANGUAGE_GERMAN String readOnly

German language code

LANGUAGE_SPANISH String readOnly

Spanish language code

LANGUAGE_DUTCH String readOnly

Spanish language code

LANGUAGE_RUSSIAN String readOnly

Russian language code

LANGUAGE_KOREAN String readOnly

Korean language code

LANGUAGE_JAPANESE String readOnly

Japanese language code

LANGUAGE_HUNGARIAN String readOnly

Hungarian language code

LANGUAGE_PORTUGUESE String readOnly

Portuguese language code

LANGUAGE_ARABIC String readOnly

Arabic language code

LANGUAGE_NORWEGIAN String readOnly

Norwegian language code

LANGUAGE_POLISH String readOnly

Polish language code

LANGUAGE_UNKNOWN String readOnly

Unknown language code

OS_IOS String readOnly

OS_ANDROID String readOnly

OS_WINDOWS String readOnly

OS_MARMALADE String readOnly

OS_LINUX String readOnly

OS_BADA String readOnly

OS_BLACKBERRY String readOnly

OS_OSX String readOnly

OS_WP8 String readOnly

OS_WINRT String readOnly

OS_UNKNOWN String readOnly

UNKNOWN Number readOnly

WIN32 Number readOnly

LINUX Number readOnly

MACOS Number readOnly

ANDROID Number readOnly

IOS Number readOnly

IPAD Number readOnly

BLACKBERRY Number readOnly

NACL Number readOnly

EMSCRIPTEN Number readOnly

TIZEN Number readOnly

WINRT Number readOnly

WP8 Number readOnly

MOBILE_BROWSER Number readOnly

DESKTOP_BROWSER Number readOnly

EDITOR_PAGE Number readOnly

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

EDITOR_CORE Number readOnly

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

BROWSER_TYPE_WECHAT String readOnly

BROWSER_TYPE_WECHAT

BROWSER_TYPE_ANDROID String readOnly

BROWSER_TYPE_IE String readOnly

BROWSER_TYPE_QQ String readOnly

BROWSER_TYPE_MOBILE_QQ String readOnly

BROWSER_TYPE_UC String readOnly

BROWSER_TYPE_360 String readOnly

BROWSER_TYPE_BAIDU_APP String readOnly

BROWSER_TYPE_BAIDU String readOnly

BROWSER_TYPE_MAXTHON String readOnly

BROWSER_TYPE_OPERA String readOnly

BROWSER_TYPE_OUPENG String readOnly

BROWSER_TYPE_MIUI String readOnly

BROWSER_TYPE_FIREFOX String readOnly

BROWSER_TYPE_SAFARI String readOnly

BROWSER_TYPE_CHROME String readOnly

BROWSER_TYPE_LIEBAO String readOnly

BROWSER_TYPE_QZONE String readOnly

BROWSER_TYPE_SOUGOU String readOnly

BROWSER_TYPE_UNKNOWN String readOnly

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 system

platform Number

Indicate the running platform

language String

Indicate the current language of the running system

os String

Indicate the running os name

browserType String

Indicate the running browser type

browserVersion Number

Indicate the running browser version

windowPixelResolution Number

Indicate the real pixel resolution of the whole game window

localStorage Object

cc.sys.localStorage is a local storage component.

capabilities Object

The capabilities of the current platform

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

Methods

garbageCollect ( )

Forces the garbage collection, only available in JSB

dumpRoot ( )

Dumps rooted objects, only available in JSB

restartVM ( )

Restart the JS VM, only available in JSB

cleanScript
(
  • jsfile
)

Clean a script in the JS VM, only available in JSB

name type description
jsfile String

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

name type description
obj Object

returns:

type: Boolean

Validity of the object

dump ( )

Dump system informations

openURL
(
  • url
)

Open a url in browser

name type description
url String

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index